package com.paperless.sdk;

import android.graphics.PointF;
import android.os.Build;
import android.util.Log;

import androidx.annotation.RequiresApi;

import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.SPUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.google.protobuf.ByteString;
import com.google.protobuf.InvalidProtocolBufferException;
import com.mogujie.tt.protobuf.*;
import com.paperless.model.CallValue;
import com.paperless.model.ResId;
import com.paperless.util.CheckUtil;
import com.paperless.util.SDKUtil;

import java.io.File;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * @author Created by xlk on 2021/9/17.
 * @desc java调用c++的方法
 */
public class JniHelper {
    private final String TAG = "JniHelper-->";
    private final Call jni;

    private static final class InstanceHolder {
        static final JniHelper instance = new JniHelper();
    }

    public static JniHelper getInstance() {
        return InstanceHolder.instance;
    }

    private JniHelper() {
        jni = Call.getInstance();
    }

    public static ByteString s2b(String name) {
        return ByteString.copyFrom(name, Charset.forName("UTF-8"));
    }

    @RequiresApi(api = android.os.Build.VERSION_CODES.O)
    public static String getUUID() {
        String replace = UUID.randomUUID().toString().replace("-", "");
        String my_uuid = SPUtils.getInstance().getString("my_uuid", replace);
        SPUtils.getInstance().put("my_uuid", my_uuid);
        return my_uuid;
    }

    //平台初始化相关

    /**
     * 平台初始化
     *
     * @param programType {@link InterfaceMacro.Pb_ProgramType}
     * @param iniFilePath ini文件绝对路径
     * @param uniqueId    设备唯一值
     */
    public int initialization(int programType, String iniFilePath, String uniqueId) {
        return initialization(programType, iniFilePath, uniqueId, 4, 0);
    }

    public int initialization(int programType, String iniFilePath, String uniqueId, int streamnum, int log2file) {
        LogUtils.i("---initialization--- uniqueId=" + uniqueId);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
            uniqueId = getUUID();
        }
        InterfaceBase.pbui_MeetCore_InitParam pb = InterfaceBase.pbui_MeetCore_InitParam.newBuilder()
                .setPconfigpathname(s2b(iniFilePath))
                .setProgramtype(programType)
                .setStreamnum(streamnum)
                .setLogtofile(log2file)
                .setKeystr(s2b(uniqueId))
                .build();
        int ret = jni.Init_walletSys(pb.toByteArray());
        jni.InitSetDirectBuf();
        LogUtils.i("initialization=" + uniqueId + ",ret=" + ret);
        return ret;
    }

    /**
     * 加入会议前可缓存的数据
     */
    public void cacheBeforeJoinMeeting() {
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETFACECONFIG.getNumber());//界面配置
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEFAULTURL.getNumber());//会议网页
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PEOPLE.getNumber());//常用人员信息
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ROOM.getNumber());//会场
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ROOMDEVICE.getNumber());//会场设备
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETSEAT.getNumber());//会议排位
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETINFO.getNumber());//会议信息
    }

    /**
     * 加入会议后可缓存的数据
     */
    public void cacheAfterJoinMeeting() {
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEFAULTURL.getNumber());//会议网页
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBER.getNumber());//参会人信息(不然收不到参会人变更通知)
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEFACESHOW.getNumber());//设备会议信息
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETAGENDA.getNumber());//会议议程
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETBULLET.getNumber());//会议公告
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORY.getNumber());//会议目录
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETVIDEO.getNumber());//会议视频
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETTABLECARD.getNumber());//会议桌牌
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETVOTEINFO.getNumber());//会议投票信息
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETVOTESIGNED.getNumber());//会议投票提交人信息
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETSIGN.getNumber());//会议签到
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_FUNCONFIG.getNumber());//会议功能配置
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBERPERMISSION.getNumber());//参会人员权限信息
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_FILESCOREVOTE.getNumber());//自定义文件评分投票
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_TOPIC.getNumber());//会议议题
        cache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETUSERDEF.getNumber());//自定义数据
    }

    /**
     * 退出释放资源
     */
    public void exit() {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_EXITENV.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_EXIT.getNumber(), null);
    }

    //设备相关

    /**
     * 查询设备信息
     *
     * @return {@link InterfaceDevice.pbui_Type_DeviceDetailInfo}
     */
    public InterfaceDevice.pbui_Type_DeviceDetailInfo queryDevice() {
        return queryDevice(InterfaceDevice.Pb_DeviceExcludeFlag.Pb_DEVICE_QUERYFLAG_ZERO.getNumber());
    }

    /**
     * 查询设备
     *
     * @param type {@link InterfaceDevice.Pb_DeviceExcludeFlag}
     * @return {@link InterfaceDevice.pbui_Type_DeviceDetailInfo}
     */
    public InterfaceDevice.pbui_Type_DeviceDetailInfo queryDevice(int type) {
        InterfaceDevice.pbui_Type_DeviceDetailInfo build = InterfaceDevice.pbui_Type_DeviceDetailInfo.newBuilder()
                .setExcludetype(type)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceDevice.pbui_Type_DeviceDetailInfo info = InterfaceDevice.pbui_Type_DeviceDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 组合查询设备信息
     *
     * @param queryflag  查询标志,用于指定查询规则
     * @param devcietype 与mask结合可以查询符合的设备 devcietype & mask == devcietype参见deviceid_suffix.h
     * @param mask       0xff00000
     * @param devname    模糊查询,返回含有字符串的设备
     * @param netstate   0=离线 1=在线
     * @param meetingid  等于该会议ID的设备
     * @return InterfaceDevice.pbui_Type_DeviceDetailInfo
     */
    public InterfaceDevice.pbui_Type_DeviceDetailInfo complexQueryDevice(int queryflag, int devcietype, int mask, String devname, int netstate, int meetingid) {
        InterfaceDevice.pbui_Type_DeviceComplexQuery build = InterfaceDevice.pbui_Type_DeviceComplexQuery.newBuilder()
                .setQueryflag(queryflag)
                .setDevcietype(devcietype)
                .setMask(mask)
                .setDevname(s2b(devname))
                .setNetstate(netstate)
                .setMeetingid(meetingid)
                .setExcludetype(InterfaceDevice.Pb_DeviceExcludeFlag.Pb_DEVICE_QUERYFLAG_ZERO.getNumber())
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_COMPLEXQUERY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceDevice.pbui_Type_DeviceDetailInfo info = InterfaceDevice.pbui_Type_DeviceDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 分页查询设备信息
     *
     * @param pageindex 请求页 从0 开始
     * @param pagenum   每页项数
     * @param idval     用于分组使用,如：查询指分组中的人员,这里填写分组id
     * @return pbui_PageQueryDeviceInfo、pbui_Item_DeviceDetailInfo
     */
    public InterfaceDevice.pbui_PageQueryDeviceInfo queryDevicePage(int pageindex, int pagenum, int idval) {
        InterfaceBase.pbui_PageReqQueryInfo build = InterfaceBase.pbui_PageReqQueryInfo.newBuilder()
                .setPageindex(pageindex)
                .setPagenum(pagenum)
                .setIdval(idval)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_PAGEQUERY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceDevice.pbui_PageQueryDeviceInfo info = InterfaceDevice.pbui_PageQueryDeviceInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询指定ID的设备信息
     *
     * @param devId 设备id
     * @return InterfaceDevice.pbui_Type_DeviceDetailInfo
     */
    public InterfaceDevice.pbui_Item_DeviceDetailInfo queryDeviceById(int devId) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(devId)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceDevice.pbui_Type_DeviceDetailInfo info = InterfaceDevice.pbui_Type_DeviceDetailInfo.parseFrom(bytes);
                if (info != null && info.getPdevCount() > 0) {
                    LogUtils.i("成功 查询指定id的设备：" + devId);
                    return info.getPdev(0);
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        LogUtils.i("失败 查询指定id的设备：" + devId);
        return null;
    }

    public String queryDeviceNameById(int devId) {
        InterfaceDevice.pbui_Item_DeviceDetailInfo info = queryDeviceById(devId);
        if (info != null) {
            return info.getDevname().toStringUtf8();
        }
        return "";
    }

    public int queryDeviceFlagById(int devId) {
        InterfaceDevice.pbui_Item_DeviceDetailInfo info = queryDeviceById(devId);
        if (info != null) {
            return info.getDeviceflag();
        }
        return 0;
    }

    /**
     * 停止正在播放该设备子通道的终端播放资源
     *
     * @param devId 设备id
     * @param subId 子通道id
     */
    public void stopResourcesPlay(int devId, int subId) {
        LogUtils.i("stopResourcesPlay 停止正在播放设备(" + devId + ")子通道(" + subId + ")的所有播放资源");
        InterfaceDevice.pbui_Type_DeviceDetailInfo info = queryDevice();
        if (info != null) {
            List<InterfaceDevice.pbui_Item_DeviceDetailInfo> pdevList = info.getPdevList();
            for (InterfaceDevice.pbui_Item_DeviceDetailInfo dev : pdevList) {
                List<InterfaceDevice.pbui_SubItem_DeviceResInfo> resinfoList = dev.getResinfoList();
                for (int i = 0; i < resinfoList.size(); i++) {
                    InterfaceDevice.pbui_SubItem_DeviceResInfo res = resinfoList.get(i);
                    int playstatus = res.getPlaystatus();
                    //playstatus =Pb_DEVICE_PLAYSTATUS_MEDIA mediaid，Pb_DEVICE_PLAYSTATUS_STREAM 设备ID，Pb_DEVICE_PLAYSTATUS_TALK 对讲设备ID
                    int val = res.getVal();//采集的设备id
                    //playstatus =Pb_DEVICE_PLAYSTATUS_MEDIA 0播放中,1暂停| Pb_DEVICE_PLAYSTATUS_STREAM,Pb_DEVICE_PLAYSTATUS_TALK 子流通道
                    int val2 = res.getVal2();//采集的通道
                    //触发器创建设备ID
                    int createdeviceid = res.getCreatedeviceid();
                    if (playstatus == InterfaceMacro.Pb_DevicePlayStatus.Pb_DEVICE_PLAYSTATUS_STREAM.getNumber()) {
                        if (val == devId && val2 == subId) {
                            stopResource(0, 0, i, dev.getDevcieid());
                        }
                    }
                }
            }
        }
    }

    /**
     * 获取dev1正在播放dev2的subId号通道的所有资源通道id
     */
    public List<Integer> queryPlayingResId(int dev1, int dev2, int subId) {
        List<Integer> resIds = new ArrayList<>();
        InterfaceDevice.pbui_Item_DeviceDetailInfo info = queryDeviceById(dev1);
        if (info != null) {
            List<InterfaceDevice.pbui_SubItem_DeviceResInfo> resinfoList = info.getResinfoList();
            for (int i = 0; i < resinfoList.size(); i++) {
                InterfaceDevice.pbui_SubItem_DeviceResInfo res = resinfoList.get(i);
                int playstatus = res.getPlaystatus();
                //playstatus =Pb_DEVICE_PLAYSTATUS_MEDIA mediaid，Pb_DEVICE_PLAYSTATUS_STREAM 设备ID，Pb_DEVICE_PLAYSTATUS_TALK 对讲设备ID
                int val = res.getVal();//采集的设备id
                //playstatus =Pb_DEVICE_PLAYSTATUS_MEDIA 0播放中,1暂停| Pb_DEVICE_PLAYSTATUS_STREAM,Pb_DEVICE_PLAYSTATUS_TALK 子流通道
                int val2 = res.getVal2();//采集的通道
                //触发器创建设备ID
                int createdeviceid = res.getCreatedeviceid();
                if (playstatus == InterfaceMacro.Pb_DevicePlayStatus.Pb_DEVICE_PLAYSTATUS_STREAM.getNumber()) {
                    if (val == dev2 && val2 == subId) {
                        resIds.add(i);
                    }
                }
            }
        }
        LogUtils.i("是否正在播放： dev1=" + dev1 + ",dev2=" + dev2 + ",subId=" + subId + ",resId=" + resIds.toString());
        return resIds;
    }

    /**
     * 判断设备是否正在播放媒体文件
     *
     * @param resId    资源id
     * @param deviceId 设备id
     * @return =true 正在播放中
     */
    public boolean isPlayingMedia(int resId, int deviceId) {
        boolean isPlaying = false;
        InterfaceDevice.pbui_Item_DeviceDetailInfo info = queryDeviceById(deviceId);
        try {
            if (info != null) {
                List<InterfaceDevice.pbui_SubItem_DeviceResInfo> resinfoList = info.getResinfoList();
                InterfaceDevice.pbui_SubItem_DeviceResInfo res = resinfoList.get(resId);
                int playstatus = res.getPlaystatus();
                //playstatus =Pb_DEVICE_PLAYSTATUS_MEDIA mediaid，Pb_DEVICE_PLAYSTATUS_STREAM 设备ID，Pb_DEVICE_PLAYSTATUS_TALK 对讲设备ID
                int val = res.getVal();
                //playstatus =Pb_DEVICE_PLAYSTATUS_MEDIA 0播放中,1暂停| Pb_DEVICE_PLAYSTATUS_STREAM,Pb_DEVICE_PLAYSTATUS_TALK 子流通道
                int val2 = res.getVal2();
                //触发器创建设备ID
                int createdeviceid = res.getCreatedeviceid();
                if (playstatus == InterfaceMacro.Pb_DevicePlayStatus.Pb_DEVICE_PLAYSTATUS_MEDIA.getNumber()) {
                    isPlaying = val2 == 0;
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        LogUtils.i("是否正在播放媒体文件：resId=" + resId + ",deviceId=" + deviceId + ",isPlaying=" + isPlaying);
        return isPlaying;
    }

    /**
     * 判断设备播放媒体文件是否暂停中
     *
     * @param resId    资源id
     * @param deviceId 设备id
     * @return =true 正在暂停中，可恢复
     */
    public boolean isPausedMedia(int resId, int deviceId) {
        boolean isPaused = false;
        InterfaceDevice.pbui_Item_DeviceDetailInfo info = queryDeviceById(deviceId);
        try {
            if (info != null) {
                List<InterfaceDevice.pbui_SubItem_DeviceResInfo> resinfoList = info.getResinfoList();
                InterfaceDevice.pbui_SubItem_DeviceResInfo res = resinfoList.get(resId);
                int playstatus = res.getPlaystatus();
                //playstatus =Pb_DEVICE_PLAYSTATUS_MEDIA mediaid，Pb_DEVICE_PLAYSTATUS_STREAM 设备ID，Pb_DEVICE_PLAYSTATUS_TALK 对讲设备ID
                int val = res.getVal();
                //playstatus =Pb_DEVICE_PLAYSTATUS_MEDIA 0播放中,1暂停| Pb_DEVICE_PLAYSTATUS_STREAM,Pb_DEVICE_PLAYSTATUS_TALK 子流通道
                int val2 = res.getVal2();
                //触发器创建设备ID
                int createdeviceid = res.getCreatedeviceid();
                if (playstatus == InterfaceMacro.Pb_DevicePlayStatus.Pb_DEVICE_PLAYSTATUS_MEDIA.getNumber()) {
                    isPaused = val2 == 1;
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        LogUtils.i("是否正在播放媒体文件：resId=" + resId + ",deviceId=" + deviceId + ",isPaused=" + isPaused);
        return isPaused;
    }

    /**
     * 判断设备是否正在播放某文件
     *
     * @param resId    资源id
     * @param deviceId 设备id
     * @param mediaId  媒体id
     * @return =true 正在播放中
     */
    public boolean isPlayingMedia(int resId, int deviceId, int mediaId) {
        boolean isPlaying = false;
        InterfaceDevice.pbui_Item_DeviceDetailInfo info = queryDeviceById(deviceId);
        try {
            if (info != null) {
                List<InterfaceDevice.pbui_SubItem_DeviceResInfo> resinfoList = info.getResinfoList();
                InterfaceDevice.pbui_SubItem_DeviceResInfo res = resinfoList.get(resId);
                int playstatus = res.getPlaystatus();
                //playstatus =Pb_DEVICE_PLAYSTATUS_MEDIA mediaid，Pb_DEVICE_PLAYSTATUS_STREAM 设备ID，Pb_DEVICE_PLAYSTATUS_TALK 对讲设备ID
                int val = res.getVal();
                //playstatus =Pb_DEVICE_PLAYSTATUS_MEDIA 0播放中,1暂停| Pb_DEVICE_PLAYSTATUS_STREAM,Pb_DEVICE_PLAYSTATUS_TALK 子流通道
                int val2 = res.getVal2();
                //触发器创建设备ID
                int createdeviceid = res.getCreatedeviceid();
                if (playstatus == InterfaceMacro.Pb_DevicePlayStatus.Pb_DEVICE_PLAYSTATUS_MEDIA.getNumber()) {
                    if (val == mediaId) {
                        isPlaying = val2 == 0;
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        LogUtils.i("是否正在播放媒体文件：resId=" + resId + ",deviceId=" + deviceId + ",mediaId=" + mediaId + ",isPlaying=" + isPlaying);
        return isPlaying;
    }

    public boolean isPlaying(int dev1, int dev2, int subId) {
        boolean isPlaying = false;
        InterfaceDevice.pbui_Item_DeviceDetailInfo info = queryDeviceById(dev1);
        try {
            if (info != null) {
                List<InterfaceDevice.pbui_SubItem_DeviceResInfo> resinfoList = info.getResinfoList();
                for (int i = 0; i < resinfoList.size(); i++) {
                    InterfaceDevice.pbui_SubItem_DeviceResInfo res = resinfoList.get(i);
                    int playstatus = res.getPlaystatus();
                    //playstatus =Pb_DEVICE_PLAYSTATUS_MEDIA mediaid，Pb_DEVICE_PLAYSTATUS_STREAM 设备ID，Pb_DEVICE_PLAYSTATUS_TALK 对讲设备ID
                    int val = res.getVal();
                    //playstatus =Pb_DEVICE_PLAYSTATUS_MEDIA 0播放中,1暂停| Pb_DEVICE_PLAYSTATUS_STREAM,Pb_DEVICE_PLAYSTATUS_TALK 子流通道
                    int val2 = res.getVal2();
                    //触发器创建设备ID
                    int createdeviceid = res.getCreatedeviceid();
                    if (playstatus == InterfaceMacro.Pb_DevicePlayStatus.Pb_DEVICE_PLAYSTATUS_STREAM.getNumber()) {
                        if (val2 == subId) {//正在播放目标设备的屏幕流
                            isPlaying = val == dev2;
                        }
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        LogUtils.i("是否正在播放： dev1=" + dev1 + ",dev2=" + dev2 + ",subId=" + subId + ",isPlaying=" + isPlaying);
        return isPlaying;
    }

    /**
     * 判断设备1的指定资源通道是否正在正在播放设备2的subId通道
     *
     * @param resId 资源id
     * @param dev1  设备1
     * @param dev2  设备2
     * @param subId 采集类型 =2 屏幕，=3 摄像头
     * @return =true 正在播放中
     */
    public boolean isPlaying(int resId, int dev1, int dev2, int subId) {
        boolean isPlaying = false;
        InterfaceDevice.pbui_Item_DeviceDetailInfo info = queryDeviceById(dev1);
        try {
            if (info != null) {
                List<InterfaceDevice.pbui_SubItem_DeviceResInfo> resinfoList = info.getResinfoList();
                InterfaceDevice.pbui_SubItem_DeviceResInfo res = resinfoList.get(resId);
                int playstatus = res.getPlaystatus();
                //playstatus =Pb_DEVICE_PLAYSTATUS_MEDIA mediaid，Pb_DEVICE_PLAYSTATUS_STREAM 设备ID，Pb_DEVICE_PLAYSTATUS_TALK 对讲设备ID
                int val = res.getVal();
                //playstatus =Pb_DEVICE_PLAYSTATUS_MEDIA 0播放中,1暂停| Pb_DEVICE_PLAYSTATUS_STREAM,Pb_DEVICE_PLAYSTATUS_TALK 子流通道
                int val2 = res.getVal2();
                //触发器创建设备ID
                int createdeviceid = res.getCreatedeviceid();
                if (playstatus == InterfaceMacro.Pb_DevicePlayStatus.Pb_DEVICE_PLAYSTATUS_STREAM.getNumber()) {
                    if (val2 == subId) {//正在播放目标设备的屏幕流
                        isPlaying = val == dev2;
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        LogUtils.i("是否正在播放：resId=" + resId + ",dev1=" + dev1 + ",dev2=" + dev2 + ",subId=" + subId + ",isPlaying=" + isPlaying);
        return isPlaying;
    }

    /**
     * 判断是否连接服务器（在线）
     *
     * @return 是否在线
     */
    public boolean isOnline(int devId) {
        boolean online = false;
        byte[] bytes = queryDeviceAttributeByAttributeID(devId, InterfaceMacro.Pb_MeetDevicePropertyID.Pb_MEETDEVICE_PROPERTY_NETSTATUS.getNumber(), 0);
        if (bytes != null) {
            try {
                InterfaceDevice.pbui_DeviceInt32uProperty pbui_deviceInt32uProperty = InterfaceDevice.pbui_DeviceInt32uProperty.parseFrom(bytes);
                int propertyval = pbui_deviceInt32uProperty.getPropertyval();
                online = propertyval == 1;
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        LogUtils.e("---在线状态---" + online);
        return online;
    }

    /**
     * 判断设备是否免签到进入会议
     *
     * @param devId
     * @return
     */
    public boolean isExemptCheckIn(int devId) {
        byte[] bytes = queryDeviceAttributeByAttributeID(devId, InterfaceMacro.Pb_MeetDevicePropertyID.Pb_MEETDEVICE_PROPERTY_DEVICEFLAG.getNumber(),
                0);
        if (bytes == null) {
            return false;
        }
        try {
            InterfaceDevice.pbui_DeviceInt32uProperty info = InterfaceDevice.pbui_DeviceInt32uProperty.parseFrom(bytes);
            int deviceFlag = info.getPropertyval();
            if ((deviceFlag & InterfaceMacro.Pb_MeetDeviceFlag.Pb_MEETDEVICE_FLAG_DIRECTENTER_VALUE)
                    == InterfaceMacro.Pb_MeetDeviceFlag.Pb_MEETDEVICE_FLAG_DIRECTENTER_VALUE) {
                return true;
            }
        } catch (InvalidProtocolBufferException e) {
            e.printStackTrace();
        }
        return false;
    }

    public int queryBoundParentDeviceId(int devId) {
        int parentDevId = 0;
        byte[] bytes = queryDeviceAttributeByAttributeID(
                devId,
                InterfaceMacro.Pb_MeetDevicePropertyID.Pb_MEETDEVICE_PROPERTY_PARENTDEVICE_VALUE,
                0);
        if (bytes != null) {
            try {
                InterfaceDevice.pbui_DeviceInt32uProperty info = InterfaceDevice.pbui_DeviceInt32uProperty.parseFrom(bytes);
                parentDevId = info.getPropertyval();
            } catch (InvalidProtocolBufferException e) {
                throw new RuntimeException(e);
            }
        }
        LogUtils.i(devId + " 的父设备id：" + parentDevId);
        return parentDevId;
    }

    /**
     * 按属性ID查询指定设备属性
     *
     * @param devId       设备id 为0表示本机设备ID
     * @param propertyid  数据ID Pb_MeetDevicePropertyID
     * @param paramterval 传入参数
     * @return pbui_DeviceInt32uProperty（整数）、pbui_DeviceStringProperty（字符串）
     */
    public byte[] queryDeviceAttributeByAttributeID(int devId, int propertyid, int paramterval) {
        InterfaceDevice.pbui_MeetDeviceQueryProperty build = InterfaceDevice.pbui_MeetDeviceQueryProperty.newBuilder()
                .setDeviceid(devId)
                .setPropertyid(propertyid)
                .setParamterval(paramterval)
                .build();
        return jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERYPROPERTY.getNumber(), build.toByteArray());
    }


    /**
     * 修改设备信息
     *
     * @param modflag       指定需要修改的标志位 参见 Pb_DeviceModifyFlag
     * @param devcieid      设备id
     * @param devname       设备名称
     * @param ipAddrInfos   ip信息
     * @param liftgroupres0 升降话筒组ID
     * @param liftgroupres1 升降话筒组ID
     * @param deviceflag    参见 Interface_Macro.proto Pb_MeetDeviceFlag 定义
     */
    public void modifyDevice(int modflag, int devcieid, String devname, List<InterfaceDevice.pbui_SubItem_DeviceIpAddrInfo> ipAddrInfos,
                             int liftgroupres0, int liftgroupres1, int deviceflag) {
        InterfaceDevice.pbui_DeviceModInfo build = InterfaceDevice.pbui_DeviceModInfo.newBuilder()
                .setModflag(modflag)
                .setDevcieid(devcieid)
                .setDevname(s2b(devname))
                .addAllIpinfo(ipAddrInfos)
                .setLiftgroupres0(liftgroupres0)
                .setLiftgroupres1(liftgroupres1)
                .setDeviceflag(deviceflag)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFYINFO.getNumber(), build.toByteArray());
    }

    /**
     * 修改设备flag
     *
     * @param devId   设备id
     * @param devFlag 设备flag
     */
    public void modifyDeviceFlag(int devId, int devFlag) {
        InterfaceDevice.pbui_DeviceModInfo build = InterfaceDevice.pbui_DeviceModInfo.newBuilder()
                .setModflag(InterfaceMacro.Pb_DeviceModifyFlag.Pb_DEVICE_MODIFYFLAG_DEVICEFLAG.getNumber())
                .setDevcieid(devId)
                .setDeviceflag(devFlag)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEINFO.getNumber(), InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFYINFO.getNumber(), build.toByteArray());
    }

    public void setParentId(int tableDevId, int parentId) {
        InterfaceDevice.pbui_DeviceModInfo build = InterfaceDevice.pbui_DeviceModInfo.newBuilder()
                .setModflag(InterfaceMacro.Pb_DeviceModifyFlag.Pb_DEVICE_MODIFYFLAG_PARENTID.getNumber())
                .setDevcieid(tableDevId)
                .setParentid(parentId)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEINFO.getNumber(), InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFYINFO.getNumber(), build.toByteArray());
    }

    /**
     * 删除设备
     *
     * @param devId 设备id
     */
    public void deleteDevice(int devId) {
        deleteRoomDevice(0, devId);
        InterfaceDevice.pbui_DeviceDel build = InterfaceDevice.pbui_DeviceDel.newBuilder()
                .addDevid(devId)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 删除设备
     *
     * @param devIds 设备id集合
     */
    public void deleteDevice(List<Integer> devIds) {
        InterfaceDevice.pbui_DeviceDel build = InterfaceDevice.pbui_DeviceDel.newBuilder()
                .addAllDevid(devIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 查询可加入的同屏会话
     *
     * @return List<InterfaceDevice.pbui_Item_DeviceResPlay>
     */
    public InterfaceDevice.pbui_Type_DeviceResPlay queryCanJoinDevice() {
        InterfaceDevice.pbui_Type_DeviceResPlay build = InterfaceDevice.pbui_Type_DeviceResPlay.newBuilder()
                .setQueryflag(InterfaceDevice.Pb_DevicePlayQueryFlag.Pb_DEVICEPLAY_FLAG_SCREEN.getNumber())
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_RESINFO.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceDevice.pbui_Type_DeviceResPlay info = InterfaceDevice.pbui_Type_DeviceResPlay.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 升级设备
     *
     * @param mediaId 升级文件的媒体id
     */
    public void updateDevice(int mediaId) {
        InterfaceDevice.pbui_Type_DoDeviceUpdate build = InterfaceDevice.pbui_Type_DoDeviceUpdate.newBuilder()
                .setMediaid(mediaId)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_UPDATE.getNumber(), build.toByteArray());
    }

    //设备会议状态相关

    /**
     * 修改本机的界面状态
     *
     * @param faceStatus Pb_MeetFaceStatus
     */
    public void modifyInterfaceStatus(int faceStatus) {
        InterfaceDevice.pbui_ModDeviceMeetStatus build = InterfaceDevice.pbui_ModDeviceMeetStatus.newBuilder()
                .setFacestatus(faceStatus)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEMEETSTATUS.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 查询界面状态
     *
     * @param id Pb_MeetFaceStatus
     */
    public InterfaceDevice.pbui_MeetDeviceMeetStatus queryInterfaceStatus(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEMEETSTATUS.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceDevice.pbui_MeetDeviceMeetStatus info = InterfaceDevice.pbui_MeetDeviceMeetStatus.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 请求刷新设备的会议信息
     */
    public void refreshDeviceMeetInfo() {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEMEETSTATUS.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_REFRESH.getNumber(), null);
    }

    /**
     * 广播本机设备的会议信息
     */
    public void broadcastDeviceMeetInfo() {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEMEETSTATUS.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_BROADCAST.getNumber(), null);
    }

    //设备交互操作相关

    /**
     * 窗口缩放操作
     *
     * @param zoomper
     * @param devIds  设备Id
     * @param resIds  资源Id
     */
    public void windowBloom(int zoomper, List<Integer> devIds, List<Integer> resIds) {
        InterfaceDevice.pbui_MeetDoZoomResWin build = InterfaceDevice.pbui_MeetDoZoomResWin.newBuilder()
                .setZoomper(zoomper)
                .addAllDevid(devIds)
                .addAllRes(resIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ZOOM.getNumber(), build.toByteArray());
    }

    /**
     * 辅助签到操作
     *
     * @param devIds 设备Id
     */
    public void assistedSignIn(List<Integer> devIds) {
        InterfaceDevice.pbui_MeetDoEnterMeet build = InterfaceDevice.pbui_MeetDoEnterMeet.newBuilder()
                .addAllDevid(devIds)
                .build();
        LogUtils.i("辅助签到 设备数量：" + devIds.size() + "," + devIds);
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ENTER.getNumber(), build.toByteArray());
    }

    /**
     * 回到主界面
     *
     * @param devIds 设备Id
     */
    public void back2Home(List<Integer> devIds) {
        InterfaceDevice.pbui_MeetDoToHomePage build = InterfaceDevice.pbui_MeetDoToHomePage.newBuilder()
                .addAllDevid(devIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_BACK.getNumber(), build.toByteArray());
    }

    /**
     * 批量修改议题状态
     *
     * @param meetId 会议id
     * @param markId utc微秒数或者其它用户的标识ID
     * @param json   <json>{
     *               "item": [{
     *               "agendaid": 1,
     *               "status": 1
     *               },
     *               {
     *               "agendaid": 2,
     *               "status": 0
     *               }
     *               ]
     *               }</json>
     */
    public void batchModifyAgendaStatus(int meetId, long markId, String json) {
        InterfaceBase.pbui_Type_SmartJsonProtol build = InterfaceBase.pbui_Type_SmartJsonProtol.newBuilder()
                .setMeetid(meetId)
                .setMarkid(markId)
                .setJson(s2b(json))
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SUBMIT.getNumber(), build.toByteArray());
    }

    /**
     * 网络唤醒设备
     *
     * @param devIds 设备Id
     */
    public void wakeupDevices(List<Integer> devIds) {
        InterfaceDevice.pbui_Type_MeetDoNetReboot build = InterfaceDevice.pbui_Type_MeetDoNetReboot.newBuilder()
                .addAllDevid(devIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_REBOOT.getNumber(), build.toByteArray());
    }

    /**
     * 广播参会人员数量和签到数量
     */
    public void broadcastMemberCount() {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_BROADCAST.getNumber(), null);
    }

    /**
     * 发送请求成为管理员
     *
     * @param devIds 设备Id
     */
    public void request2Admin(List<Integer> devIds) {
        InterfaceDevice.pbui_Type_MeetRequestManage build = InterfaceDevice.pbui_Type_MeetRequestManage.newBuilder()
                .addAllDevid(devIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_REQUESTTOMANAGE.getNumber(), build.toByteArray());
    }

    /**
     * 回复请求成为管理员请求
     *
     * @param devIds     设备Id
     * @param returnCode 1=同意,0=不同意
     */
    public void response2Admin(List<Integer> devIds, int returnCode) {
        InterfaceDevice.pbui_Type_MeetResponseRequestManage build = InterfaceDevice.pbui_Type_MeetResponseRequestManage.newBuilder()
                .addAllDevid(devIds)
                .setReturncode(returnCode)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_RESPONSETOMANAGE.getNumber(), build.toByteArray());
    }

    /**
     * 发送请求参会人员权限请求
     *
     * @param devIds    设备Id
     * @param privilege Pb_MemberPermissionPropertyID
     */
    public void applyMemberPermission(List<Integer> devIds, int privilege) {
        InterfaceDevice.pbui_Type_MeetRequestPrivilege build = InterfaceDevice.pbui_Type_MeetRequestPrivilege.newBuilder()
                .addAllDevid(devIds)
                .setPrivilege(privilege)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_REQUESTPRIVELIGE.getNumber(), build.toByteArray());
    }

    public void applyMemberPermission(int devId, int privilege) {
        InterfaceDevice.pbui_Type_MeetRequestPrivilege build = InterfaceDevice.pbui_Type_MeetRequestPrivilege.newBuilder()
                .addDevid(devId)
                .setPrivilege(privilege)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_REQUESTPRIVELIGE.getNumber(), build.toByteArray());
    }

    /**
     * 回复请求参会人员权限请求
     *
     * @param devIds     设备Id
     * @param returnCode 1=同意,0=不同意
     */
    public void responseMemberPermission(List<Integer> devIds, int returnCode) {
        InterfaceDevice.pbui_Type_MeetResponseRequestPrivilege build = InterfaceDevice.pbui_Type_MeetResponseRequestPrivilege.newBuilder()
                .addAllDevid(devIds)
                .setReturncode(returnCode)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_RESPONSEPRIVELIGE.getNumber(), build.toByteArray());
    }

    /**
     * 回复请求参会人员权限请求
     *
     * @param devId      设备Id
     * @param returnCode 1=同意,0=不同意
     */
    public void responseMemberPermission(int devId, int returnCode) {
        InterfaceDevice.pbui_Type_MeetResponseRequestPrivilege build = InterfaceDevice.pbui_Type_MeetResponseRequestPrivilege.newBuilder()
                .addDevid(devId)
                .setReturncode(returnCode)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_RESPONSEPRIVELIGE.getNumber(), build.toByteArray());
    }

    /**
     * 设备定位
     *
     * @param devIds 设备Id
     */
    public void deviceLocate(List<Integer> devIds) {
        InterfaceDevice.pbui_Type_DoDeviceLocate build = InterfaceDevice.pbui_Type_DoDeviceLocate.newBuilder()
                .addAllDevid(devIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_LOCATE.getNumber(), build.toByteArray());
    }

    /**
     * 设备对讲
     *
     * @param devIds      设备Id
     * @param inviteflage 设备对讲标志 Pb_DeviceInviteFlag
     */
    public void deviceIntercom(List<Integer> devIds, int inviteflage) {
        InterfaceDevice.pbui_Type_DoDeviceChat build = InterfaceDevice.pbui_Type_DoDeviceChat.newBuilder()
                .addAllDevid(devIds)
                .setInviteflag(inviteflage)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_REQUESTINVITE.getNumber(), build.toByteArray());
    }

    /**
     * 停止设备对讲
     *
     * @param devid 发起端设备ID
     */
    public void stopDeviceIntercom(int devid) {
        InterfaceDevice.pbui_Type_DoExitDeviceChat build = InterfaceDevice.pbui_Type_DoExitDeviceChat.newBuilder()
                .setOperdeviceid(devid)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_EXITCHAT.getNumber(), build.toByteArray());
    }

    /**
     * 回复设备对讲
     *
     * @param devIds      设备Id
     * @param inviteflage 设备对讲标志 Pb_DeviceInviteFlag
     */
    public void responseDeviceIntercom(List<Integer> devIds, int inviteflage) {
        InterfaceDevice.pbui_Type_DoDeviceChat build = InterfaceDevice.pbui_Type_DoDeviceChat.newBuilder()
                .addAllDevid(devIds)
                .setInviteflag(inviteflage)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_RESPONSEINVITE.getNumber(), build.toByteArray());
    }

    /**
     * 回复设备对讲
     *
     * @param devId       设备Id
     * @param inviteflage 设备对讲标志 Pb_DeviceInviteFlag
     */
    public void responseDeviceIntercom(int devId, int inviteflage) {
        InterfaceDevice.pbui_Type_DoDeviceChat build = InterfaceDevice.pbui_Type_DoDeviceChat.newBuilder()
                .addDevid(devId)
                .setInviteflag(inviteflage)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_RESPONSEINVITE.getNumber(), build.toByteArray());
    }

    /**
     * 发送文本广播
     *
     * @param devIds   指定收到该请求的设备ID
     * @param textType 文本类型 参见 {@link InterfaceDevice.Pb_TextBroadcast_Type}
     * @param message  文本信息
     */
    public void sendTextBroadcast(List<Integer> devIds, int textType, String message) {
        InterfaceDevice.pbui_Type_MeetDoTextBrodcast build = InterfaceDevice.pbui_Type_MeetDoTextBrodcast.newBuilder()
                .addAllDevid(devIds)
                .setTexttype(textType)
                .setPtextmsg(s2b(message))
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_TEXTMSG.getNumber(), build.toByteArray());
    }

    /**
     * 发送远程配置
     *
     * @param devIds   设备id
     * @param jsonText json格式
     */
    public void remoteConfig(List<Integer> devIds, String jsonText) {
        InterfaceDevice.pbui_Type_MeetDoRemoteSet build = InterfaceDevice.pbui_Type_MeetDoRemoteSet.newBuilder()
                .addAllDeviceid(devIds)
                .setJsontext(s2b(jsonText))
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_REMOTESET.getNumber(), build.toByteArray());
    }

    //设备控制相关

    /**
     * 执行终端控制
     *
     * @param oper     参见定义 enum Pb_DeviceControlFlag
     * @param operval1 操作对应的参数 如更换主界面的媒体ID
     * @param operval2 操作对应的参数
     * @param devIds   控制的设备,为0当前会议表示所有
     */
    public void terminalControl(int oper, int operval1, int operval2, List<Integer> devIds) {
        InterfaceDevice.pbui_Type_DeviceOperControl build = InterfaceDevice.pbui_Type_DeviceOperControl.newBuilder()
                .setOper(oper)
                .setOperval1(operval1)
                .setOperval2(operval2)
                .addAllDevid(devIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICECONTROL.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_CONTROL.getNumber(), build.toByteArray());
    }

    //会议上下文相关

    /**
     * 按属性ID查询指定上下文属性
     *
     * @param propertyId 数据ID 参见 Pb_ContextPropertyID
     * @return InterfaceContext.pbui_MeetContextInfo
     */
    public InterfaceContext.pbui_MeetContextInfo queryContextAttribute(int propertyId) {
        InterfaceContext.pbui_QueryMeetContextInfo build = InterfaceContext.pbui_QueryMeetContextInfo.newBuilder()
                .setPropertyid(propertyId)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETCONTEXT.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERYPROPERTY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceContext.pbui_MeetContextInfo info = InterfaceContext.pbui_MeetContextInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 返回当前服务器毫秒UTC时间戳
     *
     * @return 单位毫秒
     */
    public long queryCurrentTime() {
        long millisecond = 0;
        InterfaceContext.pbui_MeetContextInfo info = queryContextAttribute(
                InterfaceMacro.Pb_ContextPropertyID.Pb_MEETCONTEXT_PROPERTY_UTCMICROSECONDS.getNumber());
        if (info != null) {
            millisecond = info.getProperty64Val() / 1000;//微秒转毫秒
        }
        LogUtils.i("当前服务器毫秒时间戳=" + millisecond);
        return millisecond;
    }

    /**
     * 获取当前会议的会议id
     *
     * @return 会议id
     */
    public int queryCurrentMeetId() {
        InterfaceContext.pbui_MeetContextInfo info = queryContextAttribute(
                InterfaceMacro.Pb_ContextPropertyID.Pb_MEETCONTEXT_PROPERTY_CURMEETINGID.getNumber());
        int localMeetingId = info != null ? info.getPropertyval() : 0;
        LogUtils.i("当前会议id：" + localMeetingId);
        return localMeetingId;
    }

    /**
     * 获取当前会议的会场id
     *
     * @return 会场id
     */
    public int queryCurrentRoomId() {
        InterfaceContext.pbui_MeetContextInfo info = queryContextAttribute(
                InterfaceMacro.Pb_ContextPropertyID.Pb_MEETCONTEXT_PROPERTY_CURROOMID.getNumber());
        int localRoomId = info.getPropertyval();
        LogUtils.i("当前会场id：" + localRoomId);
        return localRoomId;
    }

    public void toggleMeet(int meetId) {
        modifyContextAttribute(InterfaceMacro.Pb_ContextPropertyID.Pb_MEETCONTEXT_PROPERTY_CURMEETINGID.getNumber(), meetId);
    }

    public boolean isNoMediaServer() {
        int streamMediaCount = 0;
        InterfaceContext.pbui_MeetContextInfo info = queryContextAttribute(InterfaceMacro.Pb_ContextPropertyID.Pb_MEETCONTEXT_PROPERTY_AVAILABLEMEDIASERER_VALUE);
        if (info != null) {
            streamMediaCount = info.getPropertyval();
        }
        LogUtils.i("媒体服务器数量：" + streamMediaCount);
//        return streamMediaCount == 0;
        return false;
    }

    public boolean isNoStreamServer() {
        int streamMediaCount = 0;
        InterfaceContext.pbui_MeetContextInfo info = queryContextAttribute(InterfaceMacro.Pb_ContextPropertyID.Pb_MEETCONTEXT_PROPERTY_AVAILABLESTREAMSERVER_VALUE);
        if (info != null) {
            streamMediaCount = info.getPropertyval();
        }
        LogUtils.i("流服务器数量：" + streamMediaCount);
//        return streamMediaCount == 0;
        return false;
    }

    /**
     * 修改上下文属性
     * Pb_MemState_MainFace=0; //处于主界面
     * Pb_MemState_MemFace=1;//参会人员界面
     * Pb_MemState_AdminFace=2;//后台管理界面
     *
     * @param propertyId  数据ID 参见 {@link InterfaceMacro.Pb_ContextPropertyID}
     * @param propertyval {@link InterfaceMacro.Pb_MeetFaceStatus}
     */
    public void modifyContextAttribute(int propertyId, int propertyval) {
        InterfaceContext.pbui_MeetContextInfo build = InterfaceContext.pbui_MeetContextInfo.newBuilder()
                .setPropertyid(propertyId)
                .setPropertyval(propertyval)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETCONTEXT.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SETPROPERTY.getNumber(), build.toByteArray());
        LogUtils.e(TAG, "modifyContextAttribute:  修改上下文属性  --->>> propertyId= " + propertyId + ", propertyval = " + propertyval);
    }

    //会议议程相关

    public void saveAgenda(int meetagendatype, int mediaid, String content, List<InterfaceAgenda.pbui_ItemAgendaTimeInfo> lists) {
        InterfaceAgenda.pbui_meetAgenda build = InterfaceAgenda.pbui_meetAgenda.newBuilder()
                .setText(s2b(content))
                .setMediaid(mediaid)
                .addAllItem(lists)
                .setMeetagendatype(meetagendatype)
                .setAgendatype(meetagendatype)
                .build();
        LogUtils.i("修改文本议程 content:" + content + ",build=" + build);
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETAGENDA.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 查询当前设置的议程
     */
    public InterfaceAgenda.pbui_meetAgenda queryAgenda() {
        return queryAgenda(0xff000000);
    }

    /**
     * 查询指定类型的议程
     * <p>
     * 0xff000000 未指定类型,如果查询时agendatype等于该值会返回会议当前设置的议程类型
     * </p>
     *
     * @param agendaType 议程类型 参见Pb_AgendaType 查询时可以指定议程的类型查询
     * @return InterfaceAgenda.pbui_meetAgenda
     */
    public InterfaceAgenda.pbui_meetAgenda queryAgenda(int agendaType) {
        InterfaceAgenda.pbui_meetAgenda build = InterfaceAgenda.pbui_meetAgenda.newBuilder()
                .setAgendatype(agendaType)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETAGENDA.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceAgenda.pbui_meetAgenda info = InterfaceAgenda.pbui_meetAgenda.parseFrom(bytes);
                if (info != null) {
                    LogUtils.i("查询议程 成功");
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        LogUtils.i("查询议程 失败 bytes是否为null " + (bytes == null));
        return null;
    }

    /**
     * 添加时间轴式议程
     *
     * @param item 要添加的议题
     */
    public void addTimeAgenda(InterfaceAgenda.pbui_ItemAgendaTimeInfo item) {
        InterfaceAgenda.pbui_meetAgenda build = InterfaceAgenda.pbui_meetAgenda.newBuilder()
                .addItem(item)
                .setMeetagendatype(InterfaceMacro.Pb_AgendaType.Pb_MEET_AGENDA_TYPE_TIME.getNumber())
                .setAgendatype(InterfaceMacro.Pb_AgendaType.Pb_MEET_AGENDA_TYPE_TIME.getNumber())
                .build();
        LogUtils.i("添加时间轴议程 build=" + build);
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETAGENDA.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 修改文件议程
     *
     * @param mediaId 文件媒体id
     */
    public void modifyFileAgenda(int mediaId) {
        InterfaceAgenda.pbui_meetAgenda build = InterfaceAgenda.pbui_meetAgenda.newBuilder()
                .setMediaid(mediaId)
                .setMeetagendatype(InterfaceMacro.Pb_AgendaType.Pb_MEET_AGENDA_TYPE_FILE.getNumber())
                .setAgendatype(InterfaceMacro.Pb_AgendaType.Pb_MEET_AGENDA_TYPE_FILE.getNumber())
                .build();
        LogUtils.i("修改文件议程 mediaId:" + mediaId + ",build=" + build);
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETAGENDA.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 修改文本议程
     *
     * @param content 文本议程内容
     *                InterfaceMacro.Pb_AgendaType.Pb_MEET_AGENDA_TYPE_TEXT.getNumber()
     */
    public void modifyTextAgenda(String content) {
        modifyTextAgenda(content, InterfaceMacro.Pb_AgendaType.Pb_MEET_AGENDA_TYPE_TEXT.getNumber());
    }

    public void modifyTextAgenda(String content, int meetAgendaType) {
        InterfaceAgenda.pbui_meetAgenda build = InterfaceAgenda.pbui_meetAgenda.newBuilder()
                .setText(s2b(content))
                .setMeetagendatype(meetAgendaType)
                .setAgendatype(InterfaceMacro.Pb_AgendaType.Pb_MEET_AGENDA_TYPE_TEXT.getNumber())
                .build();
        LogUtils.i("修改文本议程 content:" + content + ",build=" + build.toString());
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETAGENDA.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 删除时间轴式议程
     *
     * @param item 要删除的议题
     */
    public void deleteTimeAgenda(InterfaceAgenda.pbui_ItemAgendaTimeInfo item) {
        InterfaceAgenda.pbui_meetAgenda build = InterfaceAgenda.pbui_meetAgenda.newBuilder()
                .addItem(item)
                .setMeetagendatype(InterfaceMacro.Pb_AgendaType.Pb_MEET_AGENDA_TYPE_TIME.getNumber())
                .setAgendatype(InterfaceMacro.Pb_AgendaType.Pb_MEET_AGENDA_TYPE_TIME.getNumber())
                .build();
        LogUtils.i("删除时间轴议程 item:" + item + ",build:" + build);
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETAGENDA.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 修改时间轴议程
     *
     * @param item 要修改的议题
     */
    public void modifyTimeAgenda(InterfaceAgenda.pbui_ItemAgendaTimeInfo item) {
        InterfaceAgenda.pbui_meetAgenda build = InterfaceAgenda.pbui_meetAgenda.newBuilder()
                .addItem(item)
                .setMeetagendatype(InterfaceMacro.Pb_AgendaType.Pb_MEET_AGENDA_TYPE_TIME.getNumber())
                .setAgendatype(InterfaceMacro.Pb_AgendaType.Pb_MEET_AGENDA_TYPE_TIME.getNumber())
                .build();
        LogUtils.i("修改时间轴议程 item:" + item + ",build:" + build);
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETAGENDA.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 修改时间轴议程
     *
     * @param items 要修改的议题
     */
    public void modifyTimeAgenda(List<InterfaceAgenda.pbui_ItemAgendaTimeInfo> items) {
        InterfaceAgenda.pbui_meetAgenda build = InterfaceAgenda.pbui_meetAgenda.newBuilder()
                .addAllItem(items)
                .setMeetagendatype(InterfaceMacro.Pb_AgendaType.Pb_MEET_AGENDA_TYPE_TIME.getNumber())
                .setAgendatype(InterfaceMacro.Pb_AgendaType.Pb_MEET_AGENDA_TYPE_TIME.getNumber())
                .build();
        LogUtils.i("时间轴议程：build=" + build);
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETAGENDA.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    public void modifyAgenda(InterfaceAgenda.pbui_meetAgenda build) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETAGENDA.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 查询时间轴指定的议程
     *
     * @param id 时间轴某一个议程id
     */
    public InterfaceAgenda.pbui_ItemAgendaTimeInfo queryTimeAgendaById(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETAGENDA.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceAgenda.pbui_meetAgenda info = InterfaceAgenda.pbui_meetAgenda.parseFrom(bytes);
                if (info != null) {
                    List<InterfaceAgenda.pbui_ItemAgendaTimeInfo> itemList = info.getItemList();
                    for (InterfaceAgenda.pbui_ItemAgendaTimeInfo item : itemList) {
                        if (item.getAgendaid() == id) {
                            return item;
                        }
                    }
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 修改时间轴指定的议程状态
     *
     * @param item 议程
     */
    public void modifyTimeAgendaStatus(InterfaceAgenda.pbui_ItemAgendaTimeInfo item) {
        InterfaceAgenda.pbui_meetAgenda build = InterfaceAgenda.pbui_meetAgenda.newBuilder()
                .setMeetagendatype(InterfaceMacro.Pb_AgendaType.Pb_MEET_AGENDA_TYPE_TIME.getNumber())
                .setAgendatype(InterfaceMacro.Pb_AgendaType.Pb_MEET_AGENDA_TYPE_TIME.getNumber())
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETAGENDA.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SET.getNumber(), build.toByteArray());
    }

    /**
     * 切换议程顺序
     *
     * @param id1 议程id
     * @param id2 议程id
     */
    public void swapAgenda(int id1, int id2) {
        InterfaceAgenda.pbui_Type_meetAgendaPos build = InterfaceAgenda.pbui_Type_meetAgendaPos.newBuilder()
                .setAgendaid1(id1)
                .setAgendaid2(id2)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETAGENDA.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MOVE.getNumber(), build.toByteArray());
    }

    /**
     * 议题排序
     *
     * @param agendaIds 议题id
     */
    public void sortAgenda(List<Integer> agendaIds) {
        InterfaceAgenda.pbui_Type_MeetingAgendaTimeSavePos build = InterfaceAgenda.pbui_Type_MeetingAgendaTimeSavePos.newBuilder()
                .addAllAgendaid(agendaIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETAGENDA.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SAVE.getNumber(), build.toByteArray());
    }

    //会议网址相关

    /**
     * 网页查询
     *
     * @return InterfaceBase.pbui_meetUrl
     */
    public InterfaceBase.pbui_meetUrl queryUrl() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEFAULTURL.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceBase.pbui_meetUrl info = InterfaceBase.pbui_meetUrl.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 网页添加
     */
    public void addUrl(int isetdefault, InterfaceBase.pbui_Item_UrlDetailInfo item) {
        InterfaceBase.pbui_meetUrl build = InterfaceBase.pbui_meetUrl.newBuilder()
                .setIsetdefault(isetdefault)
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEFAULTURL.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 网页修改
     *
     * @param isetdefault 1表示修改系统全局的 0表示修改当前会议的
     */
    public void modifyUrl(int isetdefault, InterfaceBase.pbui_Item_UrlDetailInfo item) {
        InterfaceBase.pbui_meetUrl build = InterfaceBase.pbui_meetUrl.newBuilder()
                .setIsetdefault(isetdefault)
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEFAULTURL.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }


    /**
     * 删除网页
     *
     * @param isetdefault 1表示修改系统全局的 0表示修改当前会议的
     */
    public void deleteUrl(int isetdefault, InterfaceBase.pbui_Item_UrlDetailInfo item) {
        InterfaceBase.pbui_meetUrl build = InterfaceBase.pbui_meetUrl.newBuilder()
                .setIsetdefault(isetdefault)
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEFAULTURL.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    //会议公告相关

    /**
     * 查询公告
     *
     * @return List<InterfaceBullet.pbui_Item_BulletDetailInfo>
     */
    public InterfaceBullet.pbui_BulletDetailInfo queryBullet() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETBULLET.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceBullet.pbui_BulletDetailInfo info = InterfaceBullet.pbui_BulletDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 添加公告
     */
    public void addBullet(List<InterfaceBullet.pbui_Item_BulletDetailInfo> items) {
        InterfaceBullet.pbui_BulletDetailInfo build = InterfaceBullet.pbui_BulletDetailInfo.newBuilder()
                .addAllItem(items)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETBULLET.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), build.toByteArray());
    }

    /**
     * 添加公告
     */
    public void addBullet(InterfaceBullet.pbui_Item_BulletDetailInfo item) {
        InterfaceBullet.pbui_BulletDetailInfo build = InterfaceBullet.pbui_BulletDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETBULLET.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 修改公告
     */
    public void modifyBullet(List<InterfaceBullet.pbui_Item_BulletDetailInfo> items) {
        InterfaceBullet.pbui_BulletDetailInfo build = InterfaceBullet.pbui_BulletDetailInfo.newBuilder()
                .addAllItem(items)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETBULLET.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 修改公告
     */
    public void modifyBullet(InterfaceBullet.pbui_Item_BulletDetailInfo item) {
        InterfaceBullet.pbui_BulletDetailInfo build = InterfaceBullet.pbui_BulletDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETBULLET.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 删除公告
     */
    public void deleteBullet(List<InterfaceBullet.pbui_Item_BulletDetailInfo> items) {
        InterfaceBullet.pbui_BulletDetailInfo build = InterfaceBullet.pbui_BulletDetailInfo.newBuilder()
                .addAllItem(items)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETBULLET.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 删除公告
     */
    public void deleteBullet(InterfaceBullet.pbui_Item_BulletDetailInfo item) {
        InterfaceBullet.pbui_BulletDetailInfo build = InterfaceBullet.pbui_BulletDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETBULLET.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 查询指定的公告
     *
     * @param id 公告id
     * @return
     */
    public InterfaceBullet.pbui_BulletDetailInfo queryBulletById(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETBULLET.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceBullet.pbui_BulletDetailInfo info = InterfaceBullet.pbui_BulletDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 发布公告
     *
     * @param devIds 发给那些设备，为NULL表示所有设备
     * @param bullet 要发布的公告
     */
    public void startBullet(List<Integer> devIds, InterfaceBullet.pbui_Item_BulletDetailInfo bullet) {
        InterfaceBullet.pbui_Type_MeetPublishBulletInfo build = InterfaceBullet.pbui_Type_MeetPublishBulletInfo.newBuilder()
                .addAllDeviceid(devIds)
                .setItem(bullet)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETBULLET.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_PUBLIST.getNumber(), build.toByteArray());
    }

    /**
     * 停止公告
     *
     * @param bulletId 要停止的公告的Id
     */
    public void stopBullet(int bulletId) {
        InterfaceBullet.pbui_Type_StopBullet build = InterfaceBullet.pbui_Type_StopBullet.newBuilder()
                .setBulletid(bulletId)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETBULLET.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_STOP.getNumber(), build.toByteArray());
    }

    /**
     * 修改长文本公告
     *
     * @param text 公告内容
     */
    public void modifyBullet(String text) {
        InterfaceBullet.pbui_BigBulletDetailInfo build = InterfaceBullet.pbui_BigBulletDetailInfo.newBuilder()
                .setText(s2b(text))
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETBULLET.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_UPDATE.getNumber(), build.toByteArray());
    }

    //会议管理员相关

    /**
     * 查询管理员
     *
     * @return
     */
    public InterfaceAdmin.pbui_TypeAdminDetailInfo queryAdmin() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ADMIN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceAdmin.pbui_TypeAdminDetailInfo info = InterfaceAdmin.pbui_TypeAdminDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 添加管理员
     */
    public void addAdmin(InterfaceAdmin.pbui_Item_AdminDetailInfo item) {
        InterfaceAdmin.pbui_TypeAdminDetailInfo build = InterfaceAdmin.pbui_TypeAdminDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ADMIN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 添加管理员
     */
    public void addAdmin(List<InterfaceAdmin.pbui_Item_AdminDetailInfo> items) {
        InterfaceAdmin.pbui_TypeAdminDetailInfo build = InterfaceAdmin.pbui_TypeAdminDetailInfo.newBuilder()
                .addAllItem(items)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ADMIN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 修改管理员自身的密码
     *
     * @param name   用户名
     * @param oldPwd 用户密码(ascill/md5ascill)
     * @param newPwd 用户密码(ascill/md5ascill)
     */
    public void modifyAdminPwd(String name, String oldPwd, String newPwd) {
        InterfaceAdmin.pbui_Type_AdminModifyPwd build = InterfaceAdmin.pbui_Type_AdminModifyPwd.newBuilder()
                .setAdminname(s2b(name))
                .setAdminoldpwd(s2b(oldPwd))
                .setAdminnewpwd(s2b(newPwd))
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ADMIN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SET.getNumber(), build.toByteArray());
    }

    /**
     * 修改管理员
     */
    public void modifyAdmin(InterfaceAdmin.pbui_Item_AdminDetailInfo item) {
        InterfaceAdmin.pbui_TypeAdminDetailInfo build = InterfaceAdmin.pbui_TypeAdminDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ADMIN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 修改管理员
     */
    public void modifyAdmin(List<InterfaceAdmin.pbui_Item_AdminDetailInfo> items) {
        InterfaceAdmin.pbui_TypeAdminDetailInfo build = InterfaceAdmin.pbui_TypeAdminDetailInfo.newBuilder()
                .addAllItem(items)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ADMIN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 删除管理员
     */
    public void deleteAdmin(InterfaceAdmin.pbui_Item_AdminDetailInfo item) {
        InterfaceAdmin.pbui_TypeAdminDetailInfo build = InterfaceAdmin.pbui_TypeAdminDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ADMIN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 删除管理员
     */
    public void deleteAdmin(List<InterfaceAdmin.pbui_Item_AdminDetailInfo> items) {
        InterfaceAdmin.pbui_TypeAdminDetailInfo build = InterfaceAdmin.pbui_TypeAdminDetailInfo.newBuilder()
                .addAllItem(items)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ADMIN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 管理员登录
     *
     * @param isascill  =0md5字符密码 =1明文密码
     * @param name      用户名 常用人员手机号
     * @param pwd       用户密码(ascill/md5ascill)
     * @param loginMode =0管理员登陆 =1常用人员登陆 =2离线本地模式
     */
    public void login(int isascill, String name, String pwd, int loginMode) {
        InterfaceAdmin.pbui_Type_AdminLogon build = InterfaceAdmin.pbui_Type_AdminLogon.newBuilder()
                .setIsascill(isascill)
                .setAdminname(s2b(name))
                .setAdminpwd(s2b(pwd))
                .setLogonmode(loginMode)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ADMIN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_LOGON.getNumber(), build.toByteArray());
    }

    //管理可控会场相关

    /**
     * 查询会议管理员控制的会场
     *
     * @param id 管理员id
     * @return InterfaceAdmin.pbui_Type_MeetManagerRoomDetailInfo
     */
    public InterfaceAdmin.pbui_Type_MeetManagerRoomDetailInfo queryRoomByAdmin(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MANAGEROOM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceAdmin.pbui_Type_MeetManagerRoomDetailInfo info = InterfaceAdmin.pbui_Type_MeetManagerRoomDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 保存会议管理员控制的会场
     *
     * @param adminId 管理员ID
     * @param roomIds 会场ID
     */
    public void saveAdminRoom(int adminId, List<Integer> roomIds) {
        InterfaceAdmin.pbui_Type_MeetManagerRoomDetailInfo build = InterfaceAdmin.pbui_Type_MeetManagerRoomDetailInfo.newBuilder()
                .setMgrid(adminId)
                .addAllRoomid(roomIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MANAGEROOM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SAVE.getNumber(), build.toByteArray());
    }

    //文件下载相关


    /**
     * 清空下载
     */
    public void clearDownload() {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DOWNLOAD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_CLEAR.getNumber(), null);
    }

    /**
     * 创建一个文件下载
     *
     * @param mediaid    文件媒体id
     * @param newfile    设置是否重新下载,0 不覆盖同名文件,重新下载
     * @param onlyfinish 1表示只需要结束的通知
     * @param filePath   下载媒体全路径名称
     * @param userstr    用户传入的自定义字串(长度不能超过 Pb_DEFAULT_DESCRIBE_LENG 定义的长度)
     */
    public void downloadFile(int mediaid, int newfile, int onlyfinish, String filePath, String userstr) {
        if (isNoMediaServer()) {
            ToastUtils.showLong("没有找到媒体服务器，请检查...");
            return;
        }
        filePath = CheckUtil.checkFilePath(filePath);
        InterfaceDownload.pbui_Type_DownloadStart build = InterfaceDownload.pbui_Type_DownloadStart.newBuilder()
                .setMediaid(mediaid)
                .setNewfile(newfile)
                .setOnlyfinish(onlyfinish)
                .setPathname(s2b(filePath))
                .setUserstr(s2b(userstr))
                .build();
        LogUtils.i("下载文件 文件字符长度 length:" + filePath.getBytes(StandardCharsets.UTF_8).length + ",mediaid:" + mediaid + ",userstr=" + userstr + ",filePath=" + filePath);
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DOWNLOAD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 创建一个文件离线本地缓存,执行离线本地缓存 注:需要会议、会议室、会议目录、会议目录文件都准备好才会成功执行
     *
     * @param dirId      下载目录id
     * @param mediaid    下载媒体id
     * @param newfile    设置是否重新下载,0 不覆盖同名文件,重新下载
     * @param onlyfinish 1表示只需要结束的通知
     * @param userstr    用户传入的自定义字串(长度不能超过 Pb_DEFAULT_DESCRIBE_LENG 定义的长度)
     */
    public void cacheFile(int dirId, int mediaid, int newfile, int onlyfinish, String userstr) {
        InterfaceDownload.pbui_Type_DownloadCache build = InterfaceDownload.pbui_Type_DownloadCache.newBuilder()
                .setDirid(dirId)
                .setMediaid(mediaid)
                .setNewfile(newfile)
                .setOnlyfinish(onlyfinish)
                .setUserstr(s2b(userstr))
                .build();
        LogUtils.i("缓存到离线文件：" + dirId + "," + mediaid);
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DOWNLOAD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SAVE.getNumber(), build.toByteArray());
    }

    /**
     * 删除一个文件下载
     *
     * @param mediaId 下载媒体id
     */
    public void deleteDownload(int mediaId) {
        InterfaceDownload.pbui_Type_DownloadDel build = InterfaceDownload.pbui_Type_DownloadDel.newBuilder()
                .setMediaid(mediaId)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DOWNLOAD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    //文件上传相关

    /**
     * 上传文件
     *
     * @param uploadflag  上传标志 参见 {@link InterfaceMacro.Pb_Upload_Flag}
     * @param dirid       上传的目录ID
     * @param attrib      文件属性 参见 {@link InterfaceMacro.Pb_MeetFileAttrib}
     * @param newname     上传后的文件名
     * @param pathname    全路径名
     * @param userval     用户自定义的值
     * @param userstr     用户传入的自定义字串
     * @param dirfileflag 新协议使用 {@link InterfaceFile.Pb_MeetFile_Flag#Pb_MEETFILE_FLAG_SHOWSTATUS} or
     *                    {@link InterfaceFile.Pb_MeetFile_Flag#Pb_MEETFILE_FLAG_VOTE} or
     *                    {@link InterfaceFile.Pb_MeetFile_Flag#Pb_MEETFILE_FLAG_ENCRYPT} or
     *                    {@link InterfaceFile.Pb_MeetFile_Flag#Pb_MEETFILE_FLAG_PWDECRYPT}
     */
    public InterfaceUpload.pbui_TypeUploadReturn uploadFile(int uploadflag, int dirid, int attrib, String newname,
                                                            String pathname, int userval, String userstr, int dirfileflag) {
        if (attrib == InterfaceMacro.Pb_MeetFileAttrib.Pb_MEETFILE_ATTRIB_DEVICEUPDATE_VALUE) {
            if (dirid != 0) {
                ToastUtils.showLong("升级文件只能在系统设置-其他设置界面进行上传");
                return null;
            }
        }
        if (attrib != InterfaceMacro.Pb_MeetFileAttrib.Pb_MEETFILE_ATTRIB_DEVICEUPDATE_VALUE && newname.endsWith(".upz")) {
            ToastUtils.showLong("升级文件只能在系统设置-其他设置界面进行上传");
            return null;
        }
        if (isNoMediaServer()) {
            ToastUtils.showLong("没有找到媒体服务器，请检查...");
            return null;
        }
        InterfaceUpload.pbui_Type_AddUploadFile build = InterfaceUpload.pbui_Type_AddUploadFile.newBuilder()
                .setUploadflag(uploadflag)
                .setDirid(dirid)
                .setAttrib(attrib)
                .setNewname(s2b(newname))
                .setPathname(s2b(pathname))
                .setUserval(userval)
                .setUserstr(s2b(userstr))
                .setDirfileflag(dirfileflag)
                .build();
        LogUtils.i("上传文件 pathname=" + pathname + ",dirfileflag=" + dirfileflag + ",dirid=" + dirid + ",attrib=" + attrib);
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_UPLOAD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceUpload.pbui_TypeUploadReturn info = InterfaceUpload.pbui_TypeUploadReturn.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    public InterfaceUpload.pbui_TypeUploadReturn uploadFile(int dirid, String newname, String pathname) {
        return uploadFile(0, dirid, 0, newname, pathname, 0, "", 0);
    }

    public InterfaceUpload.pbui_TypeUploadReturn uploadFile(int uploadflag, int dirid, int attrib, String newname,
                                                            String pathname, int userval, String userstr) {
        return uploadFile(uploadflag, dirid, attrib, newname, pathname, userval, userstr, 0);
    }

    /**
     * 添加本地文件到缓存目录
     *
     * @param pathname 文件全路径名
     * @param dirname  保存到那个目录,不存在会自动创建目录
     */
    public void uploadSave(String pathname, String dirname) {
        InterfaceUpload.pbui_Type_AddCacheFile build = InterfaceUpload.pbui_Type_AddCacheFile.newBuilder()
                .setPathname(s2b(pathname))
                .setDirname(s2b(dirname))
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_UPLOAD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SAVE.getNumber(), build.toByteArray());
    }

    /**
     * 查询媒体文件的编码、帧率等信息（针对音视频文件）
     *
     * @param filePath 本地文件的全路径名
     */
    public InterfaceUpload.pbui_FileCodecDetailInfo queryFileInfo(String filePath) {
        InterfaceUpload.pbui_GetFileCodecDetailInfo build = InterfaceUpload.pbui_GetFileCodecDetailInfo.newBuilder()
                .setFilepathname(s2b(filePath))
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_UPLOAD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DETAILINFO.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceUpload.pbui_FileCodecDetailInfo info = InterfaceUpload.pbui_FileCodecDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询上传文件
     *
     * @return
     */
    public InterfaceUpload.pbui_Type_UploadFileDetailInfo queryUploadFile() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_UPLOAD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceUpload.pbui_Type_UploadFileDetailInfo info = InterfaceUpload.pbui_Type_UploadFileDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 删除上传文件
     *
     * @param mediaId 文件媒体id
     */
    public void deleteUploadFile(int mediaId) {
        InterfaceUpload.pbui_Type_DelUploadFile build = InterfaceUpload.pbui_Type_DelUploadFile.newBuilder()
                .setMediaid(mediaId)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_UPLOAD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    //会议常用人员相关

    /**
     * 查询常用人员分组
     *
     * @return {@link InterfacePerson.pbui_Type_PeopleGroupDetailInfo}
     */
    public InterfacePerson.pbui_Type_PeopleGroupDetailInfo queryCommonlyMemberGroup() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PEOPLEGROUP.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfacePerson.pbui_Type_PeopleGroupDetailInfo info = InterfacePerson.pbui_Type_PeopleGroupDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 添加常用人员分组
     */
    public void addCommonlyMemberGroup(InterfacePerson.pbui_Item_PeopleGroupDetailInfo item) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PEOPLEGROUP.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(),
                InterfacePerson.pbui_Type_PeopleGroupDetailInfo.newBuilder()
                        .addItem(item).build()
                        .toByteArray());
    }

    /**
     * 修改常用人员分组
     */
    public void modifyCommonlyMemberGroup(InterfacePerson.pbui_Item_PeopleGroupDetailInfo item) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PEOPLEGROUP.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(),
                InterfacePerson.pbui_Type_PeopleGroupDetailInfo.newBuilder()
                        .addItem(item).build()
                        .toByteArray());
    }

    /**
     * 删除常用人员分组
     */
    public void deleteCommonlyMemberGroup(InterfacePerson.pbui_Item_PeopleGroupDetailInfo item) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PEOPLEGROUP.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(),
                InterfacePerson.pbui_Type_PeopleGroupDetailInfo.newBuilder()
                        .addItem(item).build()
                        .toByteArray());
    }

    /**
     * 添加常用人员分组人员
     */
    public void addCommonlyMemberGroupMember(int groupId, InterfacePerson.pbui_Item_PersonDetailInfo item) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PEOPLEGROUPITEM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(),
                InterfacePerson.pbui_Type_AddPeopleToGroup.newBuilder()
                        .setGroupid(groupId)
                        .addItem(item).build()
                        .toByteArray());
    }

    /**
     * 添加常用人员分组人员
     */
    public void addCommonlyMemberGroupMembers(int groupId, List<InterfacePerson.pbui_Item_PersonDetailInfo> items) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PEOPLEGROUPITEM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(),
                InterfacePerson.pbui_Type_AddPeopleToGroup.newBuilder()
                        .setGroupid(groupId)
                        .addAllItem(items).build()
                        .toByteArray());
    }

    public InterfacePerson.pbui_Type_PeopleInGroupDetailInfo queryCommonlyMemberGroupMember(int groupId) {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PEOPLEGROUPITEM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(),
                InterfacePerson.pbui_Type_PeopleInGroupDetailInfo.newBuilder()
                        .setGroupid(groupId)
                        .build().toByteArray());
        if (bytes != null) {
            try {
                return InterfacePerson.pbui_Type_PeopleInGroupDetailInfo.parseFrom(bytes);
            } catch (InvalidProtocolBufferException e) {
                throw new RuntimeException(e);
            }
        }
        return null;
    }

    /**
     * 保存常用人员分组人员
     *
     * @param groupId   分组ID
     * @param memberIds 人员id
     */
    public void saveCommonlyMemberGroupMember(int groupId, List<Integer> memberIds) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PEOPLEGROUPITEM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SAVE.getNumber(),
                InterfacePerson.pbui_Type_PeopleInGroupDetailInfo.newBuilder()
                        .setGroupid(groupId)
                        .addAllMemberid(memberIds).build()
                        .toByteArray());
    }

    /**
     * 删除常用人员分组人员
     *
     * @param groupId   分组ID
     * @param memberIds 人员id
     */
    public void deleteCommonlyMemberGroupMember(int groupId, List<Integer> memberIds) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PEOPLEGROUPITEM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(),
                InterfacePerson.pbui_Type_PeopleInGroupDetailInfo.newBuilder()
                        .setGroupid(groupId)
                        .addAllMemberid(memberIds).build()
                        .toByteArray());
    }

    /**
     * 移入常用人员分组人员
     *
     * @param groupId   分组ID
     * @param memberIds 人员id
     */
    public void moveCommonlyMemberGroupMember(int groupId, List<Integer> memberIds) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PEOPLEGROUPITEM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MOVE.getNumber(),
                InterfacePerson.pbui_Type_PeopleInGroupDetailInfo.newBuilder()
                        .setGroupid(groupId)
                        .addAllMemberid(memberIds).build()
                        .toByteArray());
    }

    /**
     * 查询指定ID的常用人员
     *
     * @param id 人员id
     */
    public InterfacePerson.pbui_Item_PersonDetailInfo queryCommonlyMemberById(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PEOPLE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfacePerson.pbui_Type_PersonDetailInfo info = InterfacePerson.pbui_Type_PersonDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info.getItem(0);
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询常用人员
     *
     * @return 常用人员信息
     */
    public InterfacePerson.pbui_Item_PersonDetailInfo queryCommonlyMemberByPhone(String phone) {
        InterfacePerson.pbui_Type_PersonDetailInfo info = queryCommonlyMember();
        if (info != null) {
            List<InterfacePerson.pbui_Item_PersonDetailInfo> itemList = info.getItemList();
            for (InterfacePerson.pbui_Item_PersonDetailInfo member : itemList) {
                if (member.getPhone().toStringUtf8().equals(phone)) {
                    return member;
                }
            }
        }
        return null;
    }

    /**
     * 查询常用人员
     *
     * @return 常用人员信息
     */
    public InterfacePerson.pbui_Item_PersonDetailInfo queryCommonlyMemberByName(String name) {
        InterfacePerson.pbui_Type_PersonDetailInfo info = queryCommonlyMember();
        if (info != null) {
            List<InterfacePerson.pbui_Item_PersonDetailInfo> itemList = info.getItemList();
            for (InterfacePerson.pbui_Item_PersonDetailInfo member : itemList) {
                if (member.getName().toStringUtf8().equals(name)) {
                    return member;
                }
            }
        }
        return null;
    }

    /**
     * 查询常用人员
     *
     * @return 常用人员信息
     */
    public InterfacePerson.pbui_Type_PersonDetailInfo queryCommonlyMember() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PEOPLE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfacePerson.pbui_Type_PersonDetailInfo info = InterfacePerson.pbui_Type_PersonDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 添加常用人员
     */
    public void addCommonlyMember(InterfacePerson.pbui_Item_PersonDetailInfo item) {
        InterfacePerson.pbui_Type_PersonDetailInfo build = InterfacePerson.pbui_Type_PersonDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PEOPLE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 添加常用人员
     */
    public void addCommonlyMembers(List<InterfacePerson.pbui_Item_PersonDetailInfo> items) {
        InterfacePerson.pbui_Type_PersonDetailInfo build = InterfacePerson.pbui_Type_PersonDetailInfo.newBuilder()
                .addAllItem(items)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PEOPLE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 修改常用人员
     */
    public void modifyCommonlyMember(InterfacePerson.pbui_Item_PersonDetailInfo item) {
        InterfacePerson.pbui_Type_PersonDetailInfo build = InterfacePerson.pbui_Type_PersonDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PEOPLE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 删除常用人员
     */
    public void deleteCommonlyMember(InterfacePerson.pbui_Item_PersonDetailInfo item) {
        InterfacePerson.pbui_Type_PersonDetailInfo build = InterfacePerson.pbui_Type_PersonDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PEOPLE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }
    // TODO: 2021/9/18 常用人员分组相关 
    // TODO: 2021/9/18 常用人员分组中的人员相关

    //参会人员相关

    /**
     * 查询指定id的参会人
     *
     * @param memberId 参会人id
     */
    public InterfaceMember.pbui_Item_MemberDetailInfo queryMemberById(int memberId) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(memberId)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceMember.pbui_Type_MemberDetailInfo info = InterfaceMember.pbui_Type_MemberDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info.getItem(0);
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询指定参会人
     */
    public InterfaceMember.pbui_Item_MemberDetailInfo queryMemberByName(String name) {
        InterfaceMember.pbui_Type_MemberDetailInfo info = queryMember();
        if (info != null) {
            List<InterfaceMember.pbui_Item_MemberDetailInfo> itemList = info.getItemList();
            for (InterfaceMember.pbui_Item_MemberDetailInfo member : itemList) {
                if (member.getName().toStringUtf8().equals(name)) {
                    return member;
                }
            }
        }
        return null;
    }

    /**
     * 查询指定参会人
     */
    public InterfaceMember.pbui_Item_MemberDetailInfo queryMemberByPhone(String phone) {
        InterfaceMember.pbui_Type_MemberDetailInfo info = queryMember();
        if (info != null) {
            List<InterfaceMember.pbui_Item_MemberDetailInfo> itemList = info.getItemList();
            for (InterfaceMember.pbui_Item_MemberDetailInfo member : itemList) {
                if (member.getPhone().toStringUtf8().equals(phone)) {
                    return member;
                }
            }
        }
        return null;
    }

    /**
     * 查询指定参会人
     */
    public InterfaceMember.pbui_Item_MemberDetailInfo queryMemberByPhone(String phone, String name) {
        InterfaceMember.pbui_Type_MemberDetailInfo info = queryMember();
        if (info != null) {
            List<InterfaceMember.pbui_Item_MemberDetailInfo> itemList = info.getItemList();
            for (InterfaceMember.pbui_Item_MemberDetailInfo member : itemList) {
                if (member.getPhone().toStringUtf8().equals(phone) && member.getName().toStringUtf8().equals(name)) {
                    return member;
                }
            }
        }
        return null;
    }

    /**
     * 查询参会人
     *
     * @return
     */
    public InterfaceMember.pbui_Type_MemberDetailInfo queryMember() {
        try {
            byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBER.getNumber(),
                    InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
            if (bytes != null) {
                try {
                    InterfaceMember.pbui_Type_MemberDetailInfo info = InterfaceMember.pbui_Type_MemberDetailInfo.parseFrom(bytes);
                    if (info != null) {
                        return info;
                    }
                } catch (InvalidProtocolBufferException e) {
                    e.printStackTrace();
                }
            }
        } catch (Exception e) {
            LogUtils.e("出现异常");
            e.printStackTrace();
        }
        return null;
    }

    /**
     * 添加参会人
     */
    public void addMember(InterfaceMember.pbui_Item_MemberDetailInfo item) {
        InterfaceMember.pbui_Type_MemberDetailInfo build = InterfaceMember.pbui_Type_MemberDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 添加参会人
     */
    public void addMember(List<InterfaceMember.pbui_Item_MemberDetailInfo> items) {
        if (CallValue.isMutilOper) {
            String json = SDKUtil.parseFrom(items);
            batchAddMember(InterfaceMember.Pb_MemberImportFlag.Pb_MEET_IMPORT_MEET_FLAG_ZERO_VALUE, json);
        } else {
            InterfaceMember.pbui_Type_MemberDetailInfo build = InterfaceMember.pbui_Type_MemberDetailInfo.newBuilder()
                    .addAllItem(items)
                    .build();
            jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBER.getNumber(),
                    InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
        }
    }

    /**
     * 批量添加参会人
     *
     * @param flag {@link InterfaceMember.Pb_MemberImportFlag}
     * @param json <json>
     *             {"member": [{
     *             "name": "陈工 ",
     *             "company": "xx",
     *             "job": "xx",
     *             "phone": "123456",
     *             "email": "",
     *             "comment": "",
     *             "password": "123456",
     *             "memid": "",
     *             "devid": "",
     *             "perm": "",
     *             "role": ""},{xxx},{xxx}
     *             ]}
     *             </json>
     */
    public void batchAddMember(int flag, String json) {
        InterfaceMember.pbui_Type_MemberImport build = InterfaceMember.pbui_Type_MemberImport.newBuilder()
                .setFlag(flag)
                .setJson(s2b(json))
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SUBMIT.getNumber(), build.toByteArray());
    }

    /**
     * 批量删除参会人员
     *
     * @param ids
     */
    public void batchDeleteMember(List<Integer> ids) {
        InterfaceMember.pbui_Type_ModifyMemberPos build = InterfaceMember.pbui_Type_ModifyMemberPos.newBuilder()
                .addAllMemberid(ids)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DELALL.getNumber(), build.toByteArray());
    }

    /**
     * 修改参会人
     */
    public void modifyMember(InterfaceMember.pbui_Item_MemberDetailInfo item) {
        InterfaceMember.pbui_Type_MemberDetailInfo build = InterfaceMember.pbui_Type_MemberDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 修改参会人员排序
     *
     * @param memberIds 按ID排序
     */
    public void modifyMemberSort(List<Integer> memberIds) {
        InterfaceMember.pbui_Type_ModifyMemberPos build = InterfaceMember.pbui_Type_ModifyMemberPos.newBuilder()
                .addAllMemberid(memberIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_CONTROL.getNumber(), build.toByteArray());
    }

    /**
     * 删除参会人
     */
    public void deleteMember(InterfaceMember.pbui_Item_MemberDetailInfo item) {
        InterfaceMember.pbui_Type_MemberDetailInfo build = InterfaceMember.pbui_Type_MemberDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 扫码加入会议
     *
     * @param meetingid  会议id
     * @param memberrole 需要的参会人权限,可或运算 同屏权限... {@link InterfaceMacro.Pb_MemberPermissionPropertyID }
     * @param item       人员id要为0表示新建参会人
     */
    public void scanJoinMeet(int meetingid, int memberrole, InterfaceMember.pbui_Item_MemberDetailInfo item) {
        InterfaceMember.pbui_Type_ScanEnterMeet build = InterfaceMember.pbui_Type_ScanEnterMeet.newBuilder()
                .setMeetingid(meetingid)
                .setMemberrole(memberrole)
                .mergeMemberinfo(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ENTER.getNumber(), build.toByteArray());
        LogUtils.i("扫码加入会议 meetingid=" + meetingid + ",memberrole=" + memberrole + ",memebr=" + item.getName().toStringUtf8());
    }

    /**
     * 会议短信通知
     *
     * @param templateindex 参见 InterfaceMember.Pb_MeetSMSOper 的定义 需要指定模板，后台会根据模板去发送
     */
    public void sendInform(int templateindex) {
        InterfaceMember.pbui_Type_MeetSMSNotify build = InterfaceMember.pbui_Type_MeetSMSNotify.newBuilder()
                .setTemplateindex(templateindex)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_NOTIFY.getNumber(), build.toByteArray());
    }

    /**
     * 查询参会人员属性
     *
     * @param propertyid   属性ID 参见 Pb_MemberPropertyID
     * @param parameterval 传入参数 为0表示本机设置定的人员id
     */
    public InterfaceMember.pbui_Type_MeetMembeProperty queryMemberAttribute(int propertyid, int parameterval) {
        InterfaceMember.pbui_Type_MeetMemberQueryProperty build = InterfaceMember.pbui_Type_MeetMemberQueryProperty.newBuilder()
                .setPropertyid(propertyid)
                .setParameterval(parameterval)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERYPROPERTY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceMember.pbui_Type_MeetMembeProperty info = InterfaceMember.pbui_Type_MeetMembeProperty.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查找指定人员id的名称
     *
     * @param memberId 人员id
     * @return memberName
     */
    public String queryMemberNameByMemberId(int memberId) {
        InterfaceMember.pbui_Type_MeetMembeProperty info = queryMemberAttribute(InterfaceMacro.Pb_MemberPropertyID.Pb_MEETMEMBER_PROPERTY_NAME.getNumber(), memberId);
        if (info != null) {
            return info.getPropertytext().toStringUtf8();
        }
        return "";
    }

    public String queryMemberJobByMemberId(int memberId) {
        InterfaceMember.pbui_Type_MeetMembeProperty info = queryMemberAttribute(InterfaceMacro.Pb_MemberPropertyID.Pb_MEETMEMBER_PROPERTY_JOB.getNumber(), memberId);
        if (info != null) {
            return info.getPropertytext().toStringUtf8();
        }
        return "";
    }

    public String queryMemberConmanyByMemberId(int memberId) {
        InterfaceMember.pbui_Type_MeetMembeProperty info = queryMemberAttribute(InterfaceMacro.Pb_MemberPropertyID.Pb_MEETMEMBER_PROPERTY_COMPANY.getNumber(), memberId);
        if (info != null) {
            return info.getPropertytext().toStringUtf8();
        }
        return "";
    }

    public String queryMemberNameByDeviceId(int devId) {
        InterfaceBase.pbui_CommonQueryProperty build = InterfaceBase.pbui_CommonQueryProperty.newBuilder()
                .setPropertyid(InterfaceMacro.Pb_MeetSeatPropertyID.Pb_MEETSEAT_PROPERTY_MEMBERNAME.getNumber())
                .setParameterval(devId)
                .setParameterval2(0)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETSEAT.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERYPROPERTY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceBase.pbui_CommonTextProperty info = InterfaceBase.pbui_CommonTextProperty.parseFrom(bytes);
                if (info != null) {
                    return info.getPropertyval().toStringUtf8();
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return "";
    }

    /**
     * 查询参会人员详细信息
     *
     * @return {@link InterfaceMember.pbui_Type_MeetMemberDetailInfo}
     */
    public InterfaceMember.pbui_Type_MeetMemberDetailInfo queryMemberDetailed() {
        return queryMemberDetailed(InterfaceMember.Pb_MemExcludeFlag.Pb_MEM_QUERYFLAG_ZERO.getNumber());
    }

    public InterfaceMember.pbui_Type_MeetMemberDetailInfo queryMemberDetailed(int type) {
        InterfaceMember.pbui_Type_MeetMemberDetailInfo build = InterfaceMember.pbui_Type_MeetMemberDetailInfo.newBuilder()
                .setExcludetype(type)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DETAILINFO.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceMember.pbui_Type_MeetMemberDetailInfo info = InterfaceMember.pbui_Type_MeetMemberDetailInfo.parseFrom(bytes);
                if (info != null) {
                    Log.i(TAG, "查询参会人员详细信息 成功");
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        Log.i(TAG, "查询参会人员详细信息 失败");
        return null;
    }

    //参会人员权限相关

    /**
     * 查询参会人员权限
     *
     * @return
     */
    public InterfaceMember.pbui_Type_MemberPermission queryMemberPermissions() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBERPERMISSION.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceMember.pbui_Type_MemberPermission info = InterfaceMember.pbui_Type_MemberPermission.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    public int queryMemberPermissionById(int memberId) {
        InterfaceMember.pbui_Type_MemberPermission pbui_type_memberPermission = queryMemberPermissions();
        if (pbui_type_memberPermission != null) {
            for (InterfaceMember.pbui_Item_MemberPermission item : pbui_type_memberPermission.getItemList()) {
                if (item.getMemberid() == memberId) {
                    return item.getPermission();
                }
            }
        }
        return 0;
    }

    public void saveMemberPermission(InterfaceMember.pbui_Item_MemberPermission item) {
        InterfaceMember.pbui_Type_MemberPermission build = InterfaceMember.pbui_Type_MemberPermission.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBERPERMISSION.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SAVE.getNumber(), build.toByteArray());
    }

    /**
     * 保存参会人员权限
     */
    public void saveMemberPermissions(List<InterfaceMember.pbui_Item_MemberPermission> items) {
        InterfaceMember.pbui_Type_MemberPermission build = InterfaceMember.pbui_Type_MemberPermission.newBuilder()
                .addAllItem(items)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBERPERMISSION.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SAVE.getNumber(), build.toByteArray());
    }

    /**
     * 查询参会人员权限属性
     *
     * @param propertyid 属性ID 参见 {@link InterfaceMember.Pb_MemPermProID}
     * @param memberid   传入参数 为0表示本机设置定的人员id,测试传0无效，必须传参会人id
     */
    public int queryMemberPermissionsAttribute(int propertyid, int memberid) {
        int per = 0;
        InterfaceMember.pbui_Type_MeetMemberPermissionQueryProperty build = InterfaceMember.pbui_Type_MeetMemberPermissionQueryProperty.newBuilder()
                .setPropertyid(propertyid)
                .setMemberid(memberid)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEMBERPERMISSION.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERYPROPERTY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceMember.pbui_Type_MemberPermissionProperty info = InterfaceMember.pbui_Type_MemberPermissionProperty.parseFrom(bytes);
                if (info != null) {
                    per = info.getPropertyval();
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        LogUtils.i("参会人id：" + memberid + ",参会人权限：" + per);
        return per;
    }

    public boolean checkMemberPermission(int memberId, int permissionCode) {
        InterfaceMember.pbui_Type_MemberPermission info = queryMemberPermissions();
        if (info != null) {
            List<InterfaceMember.pbui_Item_MemberPermission> itemList = info.getItemList();
            for (InterfaceMember.pbui_Item_MemberPermission item : itemList) {
                if (item.getMemberid() == memberId) {
                    int permission = item.getPermission();
                    if ((permission & permissionCode) == permissionCode) {
                        return true;
                    }
                }
            }
        } else {
            LogUtils.e("查询参会人员权限失败");
        }
        return false;
//        int per = queryMemberPermissionsAttribute(InterfaceMember.Pb_MemPermProID.Pb_MEETMEMBERPERMISSION_PROPERTY_ALLPERMISSIONS_VALUE, memberId);
//        return (per & permissionCode) == permissionCode;
    }

    public boolean checkMemberRole(int memberId) {
        int role = queryMeetRank32(InterfaceMacro.Pb_MeetSeatPropertyID.Pb_MEETSEAT_PROPERTY_ROLEBYMEMBERID_VALUE, memberId, 0);
        LogUtils.i("本机参会人角色：" + role);
        return ((role & InterfaceMacro.Pb_MeetMemberRole.Pb_role_member_compere_VALUE) == InterfaceMacro.Pb_MeetMemberRole.Pb_role_member_compere_VALUE)
                || ((role & InterfaceMacro.Pb_MeetMemberRole.Pb_role_member_secretary_VALUE) == InterfaceMacro.Pb_MeetMemberRole.Pb_role_member_secretary_VALUE)
                || ((role & InterfaceMacro.Pb_MeetMemberRole.Pb_role_admin_VALUE) == InterfaceMacro.Pb_MeetMemberRole.Pb_role_admin_VALUE);
    }
    // TODO: 2021/9/18 参会人员分组相关 
    // TODO: 2021/9/18 参会人员分组人员相关

    //设备当前会议相关

    /**
     * 查询设备会议信息
     */
    public InterfaceDevice.pbui_Type_DeviceFaceShowDetail queryDeviceMeetInfo() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEFACESHOW.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceDevice.pbui_Type_DeviceFaceShowDetail info = InterfaceDevice.pbui_Type_DeviceFaceShowDetail.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    //会议室会场相关

    /**
     * 查询会场
     *
     * @return
     */
    public InterfaceRoom.pbui_Type_MeetRoomDetailInfo queryRoom() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ROOM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceRoom.pbui_Type_MeetRoomDetailInfo info = InterfaceRoom.pbui_Type_MeetRoomDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 添加会场
     */
    public void addRoom(InterfaceRoom.pbui_Item_MeetRoomDetailInfo item) {
        InterfaceRoom.pbui_Type_MeetRoomDetailInfo build = InterfaceRoom.pbui_Type_MeetRoomDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ROOM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 修改会场
     */
    public void modifyRoom(InterfaceRoom.pbui_Item_MeetRoomDetailInfo item) {
        InterfaceRoom.pbui_Type_MeetRoomDetailInfo build = InterfaceRoom.pbui_Type_MeetRoomDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ROOM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 删除会场
     */
    public void deleteRoom(InterfaceRoom.pbui_Item_MeetRoomDetailInfo item) {
        InterfaceRoom.pbui_Type_MeetRoomDetailInfo build = InterfaceRoom.pbui_Type_MeetRoomDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ROOM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 删除会场
     */
    public void deleteRoom(int roomId) {
        InterfaceRoom.pbui_Item_MeetRoomDetailInfo build = InterfaceRoom.pbui_Item_MeetRoomDetailInfo.newBuilder()
                .setRoomid(roomId).build();
        InterfaceRoom.pbui_Type_MeetRoomDetailInfo build1 = InterfaceRoom.pbui_Type_MeetRoomDetailInfo.newBuilder()
                .addItem(build)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ROOM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build1.toByteArray());
    }

    /**
     * 查询会场属性
     *
     * @param roomId 会议室id
     */
    public int queryRoomBackground(int roomId) {
        InterfaceBase.pbui_CommonQueryProperty build = InterfaceBase.pbui_CommonQueryProperty.newBuilder()
                .setPropertyid(InterfaceMacro.Pb_MeetRoomPropertyID.Pb_MEETROOM_PROPERTY_BGPHOTOID.getNumber())
                .setParameterval(roomId)
                .setParameterval2(roomId)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ROOM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERYPROPERTY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceBase.pbui_CommonInt32uProperty info = InterfaceBase.pbui_CommonInt32uProperty.parseFrom(bytes);
                if (info != null) {
                    return info.getPropertyval();
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return 0;
    }

    /**
     * 设置会场底图信息
     *
     * @param roomid     会场id
     * @param bgpicid    如果bgpicid指定, 则不需要指bgpathname 如果指定bgpathname，则不需要指bgpicid 如果同时指定,则优先使用bgpicid
     * @param bgpathname 给会场绑定一个新的图片
     * @param userval    用户自定义的值
     */
    public InterfaceRoom.pbui_TypeSetRoomModBGReturn setRoomImg(int roomid, int bgpicid, String bgpathname, int userval) {
        InterfaceRoom.pbui_Type_MeetRoomModBGInfo build = InterfaceRoom.pbui_Type_MeetRoomModBGInfo.newBuilder()
                .setRoomid(roomid)
                .setBgpicid(bgpicid)
                .setBgpathname(s2b(bgpathname))
                .setUserval(userval)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ROOM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SET.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceRoom.pbui_TypeSetRoomModBGReturn info = InterfaceRoom.pbui_TypeSetRoomModBGReturn.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询指定id的会场
     */
    public InterfaceRoom.pbui_Item_MeetRoomDetailInfo queryRoomById(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ROOM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceRoom.pbui_Type_MeetRoomDetailInfo info = InterfaceRoom.pbui_Type_MeetRoomDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info.getItem(0);
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    public String queryRoomNameById(int roomId) {
        InterfaceRoom.pbui_Item_MeetRoomDetailInfo info = queryRoomById(roomId);
        if (info != null) {
            return info.getName().toStringUtf8();
        }
        return "";
    }

    //会场设备相关

    /**
     * 添加会场设备
     *
     * @param roomId 会场id
     * @param devIds 设备id
     */
    public void addRoomDevice(int roomId, List<Integer> devIds) {
        InterfaceRoom.pbui_Type_MeetRoomModDeviceInfo build = InterfaceRoom.pbui_Type_MeetRoomModDeviceInfo.newBuilder()
                .setRoomid(roomId)
                .addAllDeviceid(devIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ROOMDEVICE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 添加会场设备
     *
     * @param roomId 会场id
     * @param devId  设备id
     */
    public void addRoomDevice(int roomId, int devId) {
        InterfaceRoom.pbui_Type_MeetRoomModDeviceInfo build = InterfaceRoom.pbui_Type_MeetRoomModDeviceInfo.newBuilder()
                .setRoomid(roomId)
                .addDeviceid(devId)
                .build();
        LogUtils.i("add room device. roomId:" + roomId + ",devId:" + devId);
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ROOMDEVICE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    public void deleteDeviceAllRoom(int devId) {
        InterfaceRoom.pbui_Type_MeetRoomDetailInfo info = queryRoom();
        if (info != null) {
            List<InterfaceRoom.pbui_Item_MeetRoomDetailInfo> itemList = info.getItemList();
            for (InterfaceRoom.pbui_Item_MeetRoomDetailInfo item : itemList) {
                deleteRoomDevice(item.getRoomid(), devId);
            }
        }
    }

    /**
     * 删除会场设备
     *
     * @param roomId 会场id
     * @param devId  设备id
     */
    public void deleteRoomDevice(int roomId, int devId) {
        InterfaceRoom.pbui_Type_MeetRoomModDeviceInfo build = InterfaceRoom.pbui_Type_MeetRoomModDeviceInfo.newBuilder()
                .setRoomid(roomId)
                .addDeviceid(devId)
                .build();
        LogUtils.i("delete room device. roomId:" + roomId + ",devId:" + devId);
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ROOMDEVICE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 删除会场设备
     *
     * @param roomId 会场id
     * @param devIds 设备id
     */
    public void deleteRoomDevice(int roomId, List<Integer> devIds) {
        InterfaceRoom.pbui_Type_MeetRoomModDeviceInfo build = InterfaceRoom.pbui_Type_MeetRoomModDeviceInfo.newBuilder()
                .setRoomid(roomId)
                .addAllDeviceid(devIds)
                .build();
        LogUtils.i("delete room device. roomId:" + roomId + ",devId:" + devIds);
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ROOMDEVICE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 设置会场设备坐标朝向信息
     * Pb_DeviceDirection
     *
     * @param roomId 会场id
     * @param items  设备
     */
    public void setRoomDeviceDirection(int roomId, List<InterfaceRoom.pbui_Item_MeetRoomDevPosInfo> items) {
        InterfaceRoom.pbui_Type_MeetRoomDevPosInfo build = InterfaceRoom.pbui_Type_MeetRoomDevPosInfo.newBuilder()
                .setRoomid(roomId)
                .addAllItem(items)
                .setExcludetype(InterfaceRoom.Pb_RoomExcludeFlag.Pb_ROOM_QUERYFLAG_ZERO.getNumber())
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ROOMDEVICE.getNumber(),
                CallValue.isMutilOper ? InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SET.getNumber() : InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SUBMIT.getNumber(),
                build.toByteArray());
    }

    /**
     * 会场设备排位详细信息
     */
    public InterfaceRoom.pbui_Type_MeetRoomDevSeatDetailInfo queryRoomDeviceDetailInfo(int roomId) {
        InterfaceRoom.pbui_Type_MeetRoomDevSeatDetailInfo build = InterfaceRoom.pbui_Type_MeetRoomDevSeatDetailInfo.newBuilder()
                .setRoomid(roomId)
                .setQueryflag(0)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ROOMDEVICE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DETAILINFO.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceRoom.pbui_Type_MeetRoomDevSeatDetailInfo info = InterfaceRoom.pbui_Type_MeetRoomDevSeatDetailInfo.parseFrom(bytes);
                if (info != null) return info;
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 判断设备是否在会场中
     *
     * @param roomId   会场id
     * @param deviceId 设备id
     * @return =true表示存在
     */
    public boolean checkDeviceInRoom(int roomId, int deviceId) {
        InterfaceRoom.pbui_Type_MeetRoomDevSeatDetailInfo roomDevices = queryRoomDeviceDetailInfo(roomId);
        if (roomDevices != null) {
            for (InterfaceRoom.pbui_Item_MeetRoomDevSeatDetailInfo item : roomDevices.getItemList()) {
                if (item.getDevid() == deviceId) return true;
            }
        }
        return false;
    }

    /**
     * 查询会场设备的流通道信息
     *
     * @param roomId 会议室id
     */
    public InterfaceVideo.pbui_Type_MeetVideoDetailInfo queryRoomDeviceStream(int roomId) {
        InterfaceRoom.pbui_Type_MeetRoomDevSeatDetailInfo build = InterfaceRoom.pbui_Type_MeetRoomDevSeatDetailInfo.newBuilder()
                .setRoomid(roomId)
                .setQueryflag(InterfaceRoom.Pb_RoomExcludeFlag.Pb_ROOM_QUERYFLAG_NOTABLEDEV.getNumber()//去掉桌牌设备类型
                        | InterfaceRoom.Pb_RoomExcludeFlag.Pb_ROOM_QUERYFLAG_NOPROJECT.getNumber()//去掉投影设备
                        | InterfaceRoom.Pb_RoomExcludeFlag.Pb_ROOM_QUERYFLAG_NOPUBLISH.getNumber()//去掉发布设备
                        | InterfaceRoom.Pb_RoomExcludeFlag.Pb_ROOM_QUERYFLAG_NOSERVICE.getNumber()//去掉茶水设备
                        | InterfaceRoom.Pb_RoomExcludeFlag.Pb_ROOM_QUERYFLAG_NOPHPCLIENT.getNumber()//去掉中转设备
                        | InterfaceRoom.Pb_RoomExcludeFlag.Pb_ROOM_QUERYFLAG_NOONEKEYSHARE.getNumber()//去掉一键同屏设备
                        | InterfaceRoom.Pb_RoomExcludeFlag.Pb_ROOM_QUERYFLAG_NOSUBMANAGE.getNumber()//去掉会议后台管理设备
                )
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ROOMDEVICE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MAKEVIDEO.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceVideo.pbui_Type_MeetVideoDetailInfo info = InterfaceVideo.pbui_Type_MeetVideoDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    //会议信息相关

    /**
     * 查询会议
     *
     * @return
     */
    public InterfaceMeet.pbui_Type_MeetMeetInfo queryMeeting() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceMeet.pbui_Type_MeetMeetInfo info = InterfaceMeet.pbui_Type_MeetMeetInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询指定id的会议
     *
     * @param meetId 会议id
     */
    public InterfaceMeet.pbui_Item_MeetMeetInfo queryMeetById(int meetId) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder().setId(meetId).build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceMeet.pbui_Type_MeetMeetInfo info = InterfaceMeet.pbui_Type_MeetMeetInfo.parseFrom(bytes);
                if (info != null) {
                    return info.getItem(0);
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 组合查询会议，调用之后监听到后台变更回调再查询所有会议，则就是组合查询的结果
     *
     * @param queryflag    {@link InterfaceMeet.pbui_Type_ComplexQueryMeetInfo}
     * @param meetingid    会议id
     * @param cacheflag    缓存标志{@link InterfaceMeet.pbui_Type_ComplexQueryMeetInfo}
     * @param roomid       会场id
     * @param status       会议状态，0为未开始会议，1为已开始会议，2为已结束会议,3为已暂停会议,4为模板会议
     * @param startutctime 开始时间 单位：UTC秒
     * @param endutctime   结束时间 单位：UTC秒
     * @param phone        常用人员电话,使用这个则必须是：常用参会人列表有该号码的参会人和会议参会人列表有该号码的参会人
     */
    public void complexQueryMeetInfo(int queryflag, int meetingid, int cacheflag, int roomid,
                                     int status, int startutctime, int endutctime, String phone) {
        InterfaceMeet.pbui_Type_ComplexQueryMeetInfo build = InterfaceMeet.pbui_Type_ComplexQueryMeetInfo.newBuilder()
                .setQueryflag(queryflag)
                .setMeetingid(meetingid)
                .setCacheflag(cacheflag)
                .setRoomid(roomid)
                .setStatus(status)
                .setStartutctime(startutctime)
                .setEndutctime(endutctime)
                .setPhone(s2b(phone))
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_COMPLEXQUERY.getNumber(), build.toByteArray());
    }

    public String queryMeetNameById(int meetId) {
        InterfaceMeet.pbui_Item_MeetMeetInfo info = queryMeetById(meetId);
        if (info != null) {
            return info.getName().toStringUtf8();
        }
        return "";
    }

    /**
     * 添加会议
     */
    public void addMeet(InterfaceMeet.pbui_Item_MeetMeetInfo item) {
        InterfaceMeet.pbui_Type_MeetMeetInfo build = InterfaceMeet.pbui_Type_MeetMeetInfo.newBuilder()
                .addItem(item)
                .build();
        LogUtils.i("添加会议：name=" + item.getName().toStringUtf8()
                + "\nroomId=" + item.getRoomId()
                + "\nroomname=" + item.getRoomname().toStringUtf8()
                + "\nsecrecy=" + item.getSecrecy()
                + "\nstartTime=" + item.getStartTime()
                + "\nendTime=" + item.getEndTime()
                + "\nsignin_type=" + item.getSigninType()
                + "\nmanagerid=" + item.getManagerid()
                + "\nstatus=" + item.getStatus()
                + "\nordername=" + item.getOrdername().toStringUtf8()
        );
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 快速创建会议
     *
     * @param buildtime 微秒级UTC时间，创建完毕后会将该值返回
     * @param roomid    会场ID
     * @param jsontext  传入json协议的指针,定义如下所示
     *                  {
     *                  "name": "会议名称",
     *                  "type": "0",
     *                  "starttime": "",
     *                  "endtime": "",
     *                  "signin_type": "0",
     *                  "managerid": "0",
     *                  "passwd": "",
     *                  "ordername": "",
     *                  "member": [{
     *                  "name": "陈工",
     *                  "company": "xx",
     *                  "job": "xx",
     *                  "phone": "123456",
     *                  "password": "123456"
     *                  }, {
     *                  "name": "陈工",
     *                  "company": "xx",
     *                  "job": "xx",
     *                  "phone": "123456",
     *                  "password": "123456"
     *                  }]
     *                  }
     */
    public void addMeetFast(long buildtime, int roomid, String jsontext) {
        InterfaceMeet.pbui_Type_FastCreateMeet build = InterfaceMeet.pbui_Type_FastCreateMeet.newBuilder()
                .setBuildtime(buildtime)
                .setRoomid(roomid)
                .setJsontext(s2b(jsontext))
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ASK.getNumber(), build.toByteArray());
    }

    /**
     * 修改会议
     */
    public void modifyMeet(InterfaceMeet.pbui_Item_MeetMeetInfo item) {
        InterfaceMeet.pbui_Type_MeetMeetInfo build = InterfaceMeet.pbui_Type_MeetMeetInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 删除会议
     */
    public void deleteMeet(InterfaceMeet.pbui_Item_MeetMeetInfo item) {
        InterfaceMeet.pbui_Type_MeetMeetInfo build = InterfaceMeet.pbui_Type_MeetMeetInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 复制会议
     */
    public void copyMeet(InterfaceMeet.pbui_Item_MeetMeetInfo item) {
        InterfaceMeet.pbui_Type_MeetMeetInfo build = InterfaceMeet.pbui_Type_MeetMeetInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DUMP.getNumber(), build.toByteArray());
    }

    /**
     * 查询会议属性
     *
     * @return pbui_CommonInt32uProperty\pbui_CommonInt64uProperty
     */
    public byte[] queryMeetAttribute(int propertyid, int parameterval, int parameterval2) {
        InterfaceBase.pbui_CommonQueryProperty build = InterfaceBase.pbui_CommonQueryProperty.newBuilder()
                .setPropertyid(propertyid)
                .setParameterval(parameterval)
                .setParameterval2(parameterval2)
                .build();
        return jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERYPROPERTY.getNumber(), build.toByteArray());
    }

    /**
     * 修改会议状态
     *
     * @param meetid 会议id
     * @param status 会议状态 参见 Pb_MeetStatus
     */
    public void modifyMeetStatus(int meetid, int status) {
        InterfaceMeet.pbui_Type_MeetModStatus build = InterfaceMeet.pbui_Type_MeetModStatus.newBuilder()
                .setMeetid(meetid)
                .setStatus(status)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFYSTATUS.getNumber(), build.toByteArray());
    }

    //会议目录相关

    /**
     * 查询会议目录
     *
     * @return
     */
    public InterfaceFile.pbui_Type_MeetDirDetailInfo queryDir() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceFile.pbui_Type_MeetDirDetailInfo info = InterfaceFile.pbui_Type_MeetDirDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询会议第一层子级目录
     *
     * @return
     */
    public InterfaceFile.pbui_Type_MeetDirDetailInfo queryFirstLayerSubDir(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder().setId(id).build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_CHILDRED.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceFile.pbui_Type_MeetDirDetailInfo info = InterfaceFile.pbui_Type_MeetDirDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询会议所有子级目录
     *
     * @return
     */
    public InterfaceFile.pbui_Type_MeetDirDetailInfo queryAllSubDir(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder().setId(id).build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ALLCHILDRED.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceFile.pbui_Type_MeetDirDetailInfo info = InterfaceFile.pbui_Type_MeetDirDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 添加会议目录
     */
    public void addDir(InterfaceFile.pbui_Item_MeetDirDetailInfo item) {
        InterfaceFile.pbui_Type_MeetDirDetailInfo build = InterfaceFile.pbui_Type_MeetDirDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 修改会议目录排序
     */
    public void modifyDirSort(List<InterfaceFile.pbui_Item_MeetingDirPosItem> items) {
        InterfaceFile.pbui_Type_ModMeetDirPos build = InterfaceFile.pbui_Type_ModMeetDirPos.newBuilder()
                .addAllItem(items)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SET.getNumber(), build.toByteArray());
    }

    /**
     * 修改会议目录
     */
    public void modifyDir(InterfaceFile.pbui_Item_MeetDirDetailInfo item) {
        InterfaceFile.pbui_Type_MeetDirDetailInfo build = InterfaceFile.pbui_Type_MeetDirDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 查询指定ID的会议目录
     */
    public InterfaceFile.pbui_Item_MeetDirDetailInfo queryDirById(int dirId) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder().setId(dirId).build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceFile.pbui_Type_MeetDirDetailInfo info = InterfaceFile.pbui_Type_MeetDirDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info.getItem(0);
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询目录路径
     *
     * @param dirId         当前目录id
     * @param parentDirPath 父目录路径 eg:目录1/目录2
     * @return eg: 目录1/目录2/目录3
     */
    public String queryDirPathNameById(int dirId, String parentDirPath) {
        InterfaceFile.pbui_Item_MeetDirDetailInfo info = queryDirById(dirId);
        if (info != null) {
            String dirName = info.getName().toStringUtf8();
            if (!dirName.isEmpty()) {
                dirName = parentDirPath.isEmpty() ? dirName : dirName + File.separator + parentDirPath;
                if (info.getParentid() != 0) {
                    return queryDirPathNameById(info.getParentid(), dirName);
                } else {
                    return dirName;
                }
            }
        }
        return parentDirPath;
    }

    /**
     * 查询指定名称的会议目录
     */
    public InterfaceFile.pbui_Item_MeetDirDetailInfo queryDirByName(String name) {
        InterfaceBase.pbui_QueryInfoByName build = InterfaceBase.pbui_QueryInfoByName.newBuilder()
                .setName(s2b(name))
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYNAME.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceFile.pbui_Type_MeetDirDetailInfo info = InterfaceFile.pbui_Type_MeetDirDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info.getItem(0);
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询会议目录属性
     *
     * @return pbui_CommonTextProperty、pbui_CommonInt32uProperty
     */
    public byte[] queryDirAttribute(int propertyid, int parameterval, int parameterval2) {
        InterfaceBase.pbui_CommonQueryProperty build = InterfaceBase.pbui_CommonQueryProperty.newBuilder()
                .setPropertyid(propertyid)
                .setParameterval(parameterval)
                .setParameterval2(parameterval2)
                .build();
        return jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERYPROPERTY.getNumber(), build.toByteArray());
    }

    /**
     * 删除会议目录
     */
    public void deleteDir(InterfaceFile.pbui_Item_MeetDirDetailInfo item) {
        InterfaceFile.pbui_Type_MeetDirDetailInfo build = InterfaceFile.pbui_Type_MeetDirDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    //会议目录文件相关

    /**
     * 查询会议目录文件
     *
     * @param dirId 目录id
     * @return
     */
    public InterfaceFile.pbui_Type_MeetDirFileDetailInfo queryFile(int dirId) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder().setId(dirId).build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORYFILE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceFile.pbui_Type_MeetDirFileDetailInfo info = InterfaceFile.pbui_Type_MeetDirFileDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 添加会议目录文件
     *
     * @param dirId 目录id
     */
    public void addFile(int dirId, List<InterfaceFile.pbui_Item_MeetDirFileDetailInfo> items) {
        InterfaceFile.pbui_Type_MeetDirFileDetailInfo build = InterfaceFile.pbui_Type_MeetDirFileDetailInfo.newBuilder()
                .setDirid(dirId)
                .addAllItem(items)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORYFILE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 修改会议目录文件
     *
     * @param dirId 目录id
     */
    public void modifyFile(int dirId, List<InterfaceFile.pbui_Item_MeetDirFileDetailInfo> items) {
        InterfaceFile.pbui_Type_MeetDirFileDetailInfo build = InterfaceFile.pbui_Type_MeetDirFileDetailInfo.newBuilder()
                .setDirid(dirId)
                .addAllItem(items)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORYFILE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 修改会议目录文件
     *
     * @param dirId 目录id
     */
    public void modifyFile(int dirId, InterfaceFile.pbui_Item_MeetDirFileDetailInfo item) {
        InterfaceFile.pbui_Type_MeetDirFileDetailInfo build = InterfaceFile.pbui_Type_MeetDirFileDetailInfo.newBuilder()
                .setDirid(dirId)
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORYFILE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 删除会议目录文件
     *
     * @param dirId 目录id
     */
    public void deleteFile(int dirId, List<InterfaceFile.pbui_Item_MeetDirFileDetailInfo> items) {
        InterfaceFile.pbui_Type_MeetDirFileDetailInfo build = InterfaceFile.pbui_Type_MeetDirFileDetailInfo.newBuilder()
                .setDirid(dirId)
                .addAllItem(items)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORYFILE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 删除会议目录文件
     *
     * @param dirId 目录id
     */
    public void deleteFile(int dirId, InterfaceFile.pbui_Item_MeetDirFileDetailInfo item) {
        InterfaceFile.pbui_Type_MeetDirFileDetailInfo build = InterfaceFile.pbui_Type_MeetDirFileDetailInfo.newBuilder()
                .setDirid(dirId)
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORYFILE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 修改会议目录文件名称
     *
     * @param dirId 目录id
     */
    public void modifyFileName(int dirId, List<InterfaceFile.pbui_Item_ModMeetDirFile> items) {
        InterfaceFile.pbui_Type_ModMeetDirFile build = InterfaceFile.pbui_Type_ModMeetDirFile.newBuilder()
                .setDirid(dirId)
                .addAllItem(items)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORYFILE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFYINFO.getNumber(), build.toByteArray());
    }

    /**
     * 修改会议目录文件名称
     *
     * @param dirId 目录id
     */
    public void modifyFile(int dirId, InterfaceFile.pbui_Item_ModMeetDirFile item) {
        InterfaceFile.pbui_Type_ModMeetDirFile build = InterfaceFile.pbui_Type_ModMeetDirFile.newBuilder()
                .setDirid(dirId)
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORYFILE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFYINFO.getNumber(), build.toByteArray());
    }

    /**
     * 修改会议目录文件排序
     *
     * @param dirId 目录id
     */
    public void modifyFileSort(int dirId, List<Integer> fileIds) {
        InterfaceFile.pbui_Type_ModMeetDirFilePos build = InterfaceFile.pbui_Type_ModMeetDirFilePos.newBuilder()
                .setDirid(dirId)
                .addAllFileid(fileIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORYFILE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SET.getNumber(), build.toByteArray());
    }

    /**
     * 查询文件属性
     *
     * @param propertyid {@link InterfaceMacro.Pb_MeetFilePropertyID}
     * @return {@link InterfaceBase.pbui_CommonInt64uProperty}、{@link InterfaceBase.pbui_CommonTextProperty}、{@link InterfaceBase.pbui_CommonInt32uProperty}
     */
    public byte[] queryFileAttribute(int propertyid, int parameterval, int parameterval2) {
        InterfaceBase.pbui_CommonQueryProperty build = InterfaceBase.pbui_CommonQueryProperty.newBuilder()
                .setPropertyid(propertyid)
                .setParameterval(parameterval)
                .setParameterval2(parameterval2)
                .build();
        return jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORYFILE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERYPROPERTY.getNumber(), build.toByteArray());
    }

    /**
     * 根据媒体ID查询文件名
     *
     * @param mediaId 文件id
     */
    public String queryFileNameByMediaId(int mediaId) {
        String fileName = "";
        byte[] bytes = queryFileAttribute(InterfaceMacro.Pb_MeetFilePropertyID.Pb_MEETFILE_PROPERTY_NAME.getNumber(), mediaId, 0);
        if (bytes != null) {
            try {
                InterfaceBase.pbui_CommonTextProperty info = InterfaceBase.pbui_CommonTextProperty.parseFrom(bytes);
                fileName = info.getPropertyval().toStringUtf8();
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        LogUtils.i("根据媒体id查询文件名 mediaId=" + mediaId + ",fileName=" + fileName);
        return fileName;
    }

    public String queryCacheFilePath(int dirId, int mediaId) {
        String filePath = "";
        byte[] bytes = queryFileAttribute(InterfaceMacro.Pb_MeetFilePropertyID.Pb_MEETFILE_PROPERTY_CACHEPATHNAME.getNumber(), mediaId, dirId);
        if (bytes != null) {
            try {
                InterfaceBase.pbui_CommonTextProperty info = InterfaceBase.pbui_CommonTextProperty.parseFrom(bytes);
                filePath = info.getPropertyval().toStringUtf8();
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        } else {
            LogUtils.e("查询结果为null");
        }
        LogUtils.i("根据媒体id查询缓存的文件路径 mediaId=" + mediaId + ",filePath=" + filePath);
        return filePath;
    }

    /**
     * 查询文件绑定的pdf文件
     *
     * @param mediaId 文件id
     * @return 绑定的pdf文件id
     */
    public int queryBindPdfFile(int mediaId) {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PUBLICINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERYPROPERTY.getNumber(),
                InterfacePublicinfo.pbui_Type_MeetPublicInfoProperty.newBuilder()
                        .setPropertyid(InterfacePublicinfo.Pb_PublicPropertyId.Pb_PUBLICINFO_PROPERTY_OFFICEBINDID_VALUE)
                        .setParameterval(mediaId)
                        .build().toByteArray());
        if (bytes != null) {
            try {
                InterfacePublicinfo.pbui_Type_MeetPublicInfoPropertyVal info = InterfacePublicinfo.pbui_Type_MeetPublicInfoPropertyVal.parseFrom(bytes);
                return info.getIntval();
            } catch (InvalidProtocolBufferException e) {
                throw new RuntimeException(e);
            }
        }
        return -1;
    }

    /**
     * 根据媒体ID查询文件是否存在
     *
     * @param mediaId 文件id
     */
    public boolean checkFileAvailable(int mediaId) {
        boolean available = false;
        byte[] bytes = queryFileAttribute(InterfaceMacro.Pb_MeetFilePropertyID.Pb_MEETFILE_PROPERTY_AVAILABLE.getNumber(), mediaId, 0);
        if (bytes != null) {
            try {
                InterfaceBase.pbui_CommonInt32uProperty info = InterfaceBase.pbui_CommonInt32uProperty.parseFrom(bytes);
                available = info.getPropertyval() == 1;
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        LogUtils.i("文件是否存在，是否可用： mediaId=" + mediaId + ",available=" + available);
        return available;
    }

    /**
     * 根据媒体ID查询文件名
     *
     * @param mediaId 文件id
     */
    public long queryFileSizeByMediaId(int mediaId) {
        long fileSize = 0;
        byte[] bytes = queryFileAttribute(InterfaceMacro.Pb_MeetFilePropertyID.Pb_MEETFILE_PROPERTY_SIZE.getNumber(), mediaId, 0);
        if (bytes != null) {
            try {
                InterfaceBase.pbui_CommonInt64uProperty info = InterfaceBase.pbui_CommonInt64uProperty.parseFrom(bytes);
                fileSize = info.getPropertyval();
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        LogUtils.i("文件名称 mediaId=" + mediaId + ",fileSize=" + fileSize);
        return fileSize;
    }

    /**
     * 分页文件高级查询
     * fixed32      dirid=1;//为0表示从平台里查询(平台里查询这种情况下 role和uploadid是无效的)
     * fixed32		 queryflag=2;//查询标志 参见 Pb_MeetFileQueryFlag
     * fixed32		 role=3;//上传者角色
     * fixed32		 uploadid=4;//上传人员ID 为0表示全部
     * fixed32		 filetype=5;//文件类型 为0表示全部 参见 Pb_MeetFileType
     * fixed32		 attrib=6;//文件属性 为0表示全部 参见 Pb_MeetFileAttrib
     * fixed32		 pageindex=7;//分页值
     * fixed32		 pagenum=8;//分页大小 为0表示返回全部
     */
    public InterfaceFile.pbui_TypePageResQueryrFileInfo pageQueryFile(int dirid, int queryflag, int role, int uploadid
            , int filetype, int attrib, int pageindex, int pagenum) {
        InterfaceFile.pbui_Type_ComplexQueryMeetDirFile build = InterfaceFile.pbui_Type_ComplexQueryMeetDirFile.newBuilder()
                .setDirid(dirid)
                .setQueryflag(queryflag)
                .setRole(role)
                .setUploadid(uploadid)
                .setFiletype(filetype)
                .setAttrib(attrib)
                .setPageindex(pageindex)
                .setPagenum(pagenum)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORYFILE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_COMPLEXPAGEQUERY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceFile.pbui_TypePageResQueryrFileInfo info = InterfaceFile.pbui_TypePageResQueryrFileInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    //会议目录权限相关

    /**
     * 查询会议目录权限
     *
     * @param id 目录id
     * @return 返回null的情况：1.确实目录里没有黑名单，全都有权限；2.没有缓存好，参会人信息、目录信息
     */
    public InterfaceFile.pbui_Type_MeetDirRightDetailInfo queryDirPermission(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORYRIGHT.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceFile.pbui_Type_MeetDirRightDetailInfo info = InterfaceFile.pbui_Type_MeetDirRightDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    public boolean hasDirPermission(int memberId, int dirId) {
        InterfaceFile.pbui_Type_MeetDirRightDetailInfo info = queryDirPermission(dirId);
        boolean hasPermission = false;
        if (info != null) {
            List<Integer> memberidList = info.getMemberidList();
            LogUtils.i(TAG, memberId + " 参会人， " + dirId + " -目录下的黑名单人员id：" + memberidList);
            hasPermission = !memberidList.contains(memberId);
        } else {
            LogUtils.e(TAG, memberId + " 参会人， " + dirId + " -目录下的黑名单人员查询失败，可能是目录下没有黑名单");
            return true;
        }
        return hasPermission;
    }

    /**
     * 保存会议目录权限
     *
     * @param dirId     目录id
     * @param memebrIds 参会人id
     */
    public void saveDirPermission(int dirId, List<Integer> memebrIds) {
        InterfaceFile.pbui_Type_MeetDirRightDetailInfo build = InterfaceFile.pbui_Type_MeetDirRightDetailInfo.newBuilder()
                .setDirid(dirId)
                .addAllMemberid(memebrIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETDIRECTORYRIGHT.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SAVE.getNumber(), build.toByteArray());
    }

    // TODO: 2021/9/18 会议文件评分相关
    // TODO: 2021/9/18 文件评价相关
    // TODO: 2021/9/18 会议评论相关
    // TODO: 2021/9/18 系统操作日志相关

    //会议视频直播相关

    /**
     * 查询会议视频
     *
     * @return
     */
    public InterfaceVideo.pbui_Type_MeetVideoDetailInfo queryVideo() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETVIDEO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceVideo.pbui_Type_MeetVideoDetailInfo info = InterfaceVideo.pbui_Type_MeetVideoDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询指定id的会议视频
     *
     * @param id 会议id
     */
    public InterfaceVideo.pbui_Item_MeetVideoDetailInfo queryVideoById(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETVIDEO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceVideo.pbui_Type_MeetVideoDetailInfo info = InterfaceVideo.pbui_Type_MeetVideoDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info.getItem(0);
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 添加会议视频
     */
    public void addVideo(InterfaceVideo.pbui_Item_MeetVideoDetailInfo item) {
        InterfaceVideo.pbui_Type_MeetVideoDetailInfo build = InterfaceVideo.pbui_Type_MeetVideoDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETVIDEO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 修改会议视频
     */
    public void modifyVideo(InterfaceVideo.pbui_Item_MeetVideoDetailInfo item) {
        InterfaceVideo.pbui_Type_MeetVideoDetailInfo build = InterfaceVideo.pbui_Type_MeetVideoDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETVIDEO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 删除会议视频
     */
    public void deleteVideo(InterfaceVideo.pbui_Item_MeetVideoDetailInfo item) {
        InterfaceVideo.pbui_Type_MeetVideoDetailInfo build = InterfaceVideo.pbui_Type_MeetVideoDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETVIDEO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    //会议桌牌相关

    /**
     * 查询会议双屏显示
     */
    public InterfaceTablecard.pbui_Type_MeetTableCardDetailInfo queryTable() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETTABLECARD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                return InterfaceTablecard.pbui_Type_MeetTableCardDetailInfo.parseFrom(bytes);
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 修改双屏显示
     *
     * @param modifyflag 修改标志 参见Pb_TableCard_ModifyFlag
     * @param bgphotoid  底图ID
     * @param items      必须是3个
     */
    public void modifyTable(int modifyflag, int bgphotoid, List<InterfaceTablecard.pbui_Item_MeetTableCardDetailInfo> items) {
        InterfaceTablecard.pbui_Type_MeetTableCardDetailInfo build = InterfaceTablecard.pbui_Type_MeetTableCardDetailInfo.newBuilder()
                .setModifyflag(modifyflag)
                .setBgphotoid(bgphotoid)
                .addAllItem(items)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETTABLECARD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    //会议排位相关

    /**
     * 查询会议排位
     *
     * @return
     */
    public InterfaceRoom.pbui_Type_MeetSeatDetailInfo queryMeetRank32() {
        InterfaceRoom.pbui_Type_MeetSeatDetailInfo build = InterfaceRoom.pbui_Type_MeetSeatDetailInfo.newBuilder()
                .setExcludetype(InterfaceRoom.Pb_RoomExcludeFlag.Pb_ROOM_QUERYFLAG_ZERO.getNumber())
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETSEAT.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceRoom.pbui_Type_MeetSeatDetailInfo info = InterfaceRoom.pbui_Type_MeetSeatDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 修改会议排位
     */
    public void modifyMeetRank(int devId, int role, int memberId) {
        InterfaceRoom.pbui_Item_MeetSeatDetailInfo.Builder builder = InterfaceRoom.pbui_Item_MeetSeatDetailInfo.newBuilder()
                .setSeatid(devId)
                .setRole(role)
                .setNameId(memberId);
        modifyMeetRank(builder.build());
    }

    /**
     * 修改会议排位
     */
    public void modifyMeetRank(InterfaceRoom.pbui_Item_MeetSeatDetailInfo item) {
        InterfaceRoom.pbui_Type_MeetSeatDetailInfo build = InterfaceRoom.pbui_Type_MeetSeatDetailInfo.newBuilder()
                .addItem(item)
                .setExcludetype(InterfaceRoom.Pb_RoomExcludeFlag.Pb_ROOM_QUERYFLAG_ZERO.getNumber())
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETSEAT.getNumber(),
                CallValue.isMutilOper ? InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SUBMIT.getNumber() : InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(),
                build.toByteArray());
    }

    /**
     * 修改会议排位
     */
    public void modifyMeetRank(List<InterfaceRoom.pbui_Item_MeetSeatDetailInfo> items) {
        InterfaceRoom.pbui_Type_MeetSeatDetailInfo build = InterfaceRoom.pbui_Type_MeetSeatDetailInfo.newBuilder()
                .addAllItem(items)
                .setExcludetype(InterfaceRoom.Pb_RoomExcludeFlag.Pb_ROOM_QUERYFLAG_ZERO.getNumber())
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETSEAT.getNumber(),
                CallValue.isMutilOper ? InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SUBMIT.getNumber() : InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(),
                build.toByteArray());
    }

    /**
     * 绑定参会人(参会人角色不变)
     *
     * @param devId    席位ID
     * @param memberId 参会人ID
     */
    public void bindMember(int devId, int memberId) {
        InterfaceRoom.pbui_Item_MeetSeatDetailInfo.Builder builder = InterfaceRoom.pbui_Item_MeetSeatDetailInfo.newBuilder()
                .setSeatid(devId)
                .setNameId(memberId);
        InterfaceRoom.pbui_Type_MeetSeatDetailInfo build = InterfaceRoom.pbui_Type_MeetSeatDetailInfo.newBuilder()
                .addItem(builder)
                .setExcludetype(InterfaceRoom.Pb_RoomExcludeFlag.Pb_ROOM_QUERYFLAG_ZERO.getNumber())
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETSEAT.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 修改参会人角色
     *
     * @param role     角色
     * @param memberId 参会人ID
     */
    public void modifyMemberRole(int role, int memberId) {
        InterfaceRoom.pbui_Item_MeetSeatDetailInfo.Builder builder = InterfaceRoom.pbui_Item_MeetSeatDetailInfo.newBuilder()
                .setRole(role)
                .setNameId(memberId);
        InterfaceRoom.pbui_Type_MeetSeatDetailInfo build = InterfaceRoom.pbui_Type_MeetSeatDetailInfo.newBuilder()
                .addItem(builder)
                .setExcludetype(InterfaceRoom.Pb_RoomExcludeFlag.Pb_ROOM_QUERYFLAG_ZERO.getNumber())
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETSEAT.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }


    public int queryMemberIdByDeviceId(int deviceId) {
        return queryMeetRank32(InterfaceMacro.Pb_MeetSeatPropertyID.Pb_MEETSEAT_PROPERTY_MEMBERID.getNumber(), deviceId, 0);
    }

    public int queryDeviceIdByMemberId(int memberId) {
        return queryMeetRank32(InterfaceMacro.Pb_MeetSeatPropertyID.Pb_MEETSEAT_PROPERTY_SEATID.getNumber(), memberId, 0);
    }

    /**
     * 查询会议排位属性
     * Pb_MeetMemberRole
     *
     * @param propertyid Pb_MeetSeatPropertyID
     */
    public int queryMeetRank32(int propertyid, int parameterval, int parameterval2) {
        InterfaceBase.pbui_CommonQueryProperty build = InterfaceBase.pbui_CommonQueryProperty.newBuilder()
                .setPropertyid(propertyid)
                .setParameterval(parameterval)
                .setParameterval2(parameterval2)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETSEAT.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERYPROPERTY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceBase.pbui_CommonInt32uProperty info = InterfaceBase.pbui_CommonInt32uProperty.parseFrom(bytes);
                if (info != null) {
                    LogUtils.i("---查询会议排位属性成功---");
                    return info.getPropertyval();
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        LogUtils.e("---查询会议排位属性失败---");
        return 0;
    }

    /**
     * 查询指定人员id的参会人身份
     *
     * @param memberId 人员id
     */
    public int queryMemberRoleByMemberId(int memberId) {
        int memberRole = queryMeetRank32(
                InterfaceMacro.Pb_MeetSeatPropertyID.Pb_MEETSEAT_PROPERTY_ROLEBYMEMBERID.getNumber(),
                memberId,
                0
        );
        LogUtils.i("当前参会人角色：memberId=" + memberId + ",memberRole=" + memberRole);
        return memberRole;
    }

    /**
     * 查询指定设备id的参会人身份
     *
     * @param deviceId 设备id
     */
    public int queryMemberRoleByDeviceId(int deviceId) {
        int memberRole = queryMeetRank32(
                InterfaceMacro.Pb_MeetSeatPropertyID.Pb_MEETSEAT_PROPERTY_ROLEBYDEVICEID.getNumber(),
                deviceId,
                0
        );
        LogUtils.i("当前参会人角色：deviceId=" + deviceId + ",memberRole=" + memberRole);
        return memberRole;
    }

    /**
     * 查询会议排位属性
     * Pb_MeetMemberRole
     *
     * @param propertyid Pb_MeetSeatPropertyID
     */
    public long queryMeetRank64(int propertyid, int parameterval, int parameterval2) {
        InterfaceBase.pbui_CommonQueryProperty build = InterfaceBase.pbui_CommonQueryProperty.newBuilder()
                .setPropertyid(propertyid)
                .setParameterval(parameterval)
                .setParameterval2(parameterval2)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETSEAT.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERYPROPERTY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceBase.pbui_CommonInt64uProperty info = InterfaceBase.pbui_CommonInt64uProperty.parseFrom(bytes);
                if (info != null) {
                    return info.getPropertyval();
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return -1;
    }

    //<editor-fold desc="会议交流相关">

    /**
     * 发送会议交流信息
     *
     * @param msgtype 消息类型 参见 Pb_MeetIMMSG_TYPE
     * @param msg     消息文本  长度 Pb_MEETIM_CHAR_MSG_MAXLEN
     * @param userids 为0表示当前会议全部 如果是会议服务类请求为0
     */
    public void sendMsg(int msgtype, String msg, List<Integer> userids) {
        InterfaceIM.pbui_Type_SendMeetIM build = InterfaceIM.pbui_Type_SendMeetIM.newBuilder()
                .setMsgtype(msgtype)
                .setMsg(s2b(msg))
                .addAllUserids(userids)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETIM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SEND.getNumber(), build.toByteArray());
    }

    /**
     * 回复收到消息
     *
     * @param confirmmsg 确认的消息文本
     */
    public void submitMsg(int meetid, int msgtype, long utcsecond, int role,
                          int memberId, int senddevid, String confirmmsg) {
        InterfaceIM.pbui_Type_MeetIMConfirm build = InterfaceIM.pbui_Type_MeetIMConfirm.newBuilder()
                .setMeetid(meetid)
                .setMsgtype(msgtype)
                .setUtcsecond(utcsecond)
                .setRole(role)
                .setMemberid(memberId)
                .setSenddevid(senddevid)
                .setConfirmmsg(s2b(confirmmsg))
                .build();
        LogUtils.i("submitMsg= " + build.toString());
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETIM.getNumber(), InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SUBMIT.getNumber(), build.toByteArray());
    }

    /**
     * 查询全部会议交流信息
     *
     * @return InterfaceIM.pbui_Type_MeetIMDetailInfo
     */
    public InterfaceIM.pbui_Type_MeetIMDetailInfo queryAllChatMessage() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETIM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceIM.pbui_Type_MeetIMDetailInfo info = InterfaceIM.pbui_Type_MeetIMDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 组合查询会议交流信息
     *
     * @param queryflag      查询标志 参见:{@link InterfaceMacro.Pb_MeetIMMSG_QueryFlag#Pb_COMPLEXQUERY_ZERO}
     *                       {@link InterfaceMacro.Pb_MeetIMMSG_QueryFlag#Pb_COMPLEXQUERY_MSGTYPE}
     *                       {@link InterfaceMacro.Pb_MeetIMMSG_QueryFlag#Pb_COMPLEXQUERY_ROLE}
     *                       {@link InterfaceMacro.Pb_MeetIMMSG_QueryFlag#Pb_COMPLEXQUERY_MEMBERID}
     *                       {@link InterfaceMacro.Pb_MeetIMMSG_QueryFlag#Pb_COMPLEXQUERY_UTCTIME}
     * @param msgtype        消息类型 参见 {@link InterfaceMacro.Pb_MeetIMMSG_TYPE#Pb_MEETIM_CHAT_Message}
     * @param role           参会人角色
     * @param memberid       参会人id
     * @param startutcsecond 开始时间
     * @param endutcsecond   结束时间
     * @param pageindex      页码
     * @param pagenum        每页数量
     * @return {@link InterfaceIM.pbui_TypePageResQueryrMsgInfo}
     */
    public InterfaceIM.pbui_TypePageResQueryrMsgInfo complexQueryChatMessage(int queryflag, int msgtype, int role, int memberid, long startutcsecond, long endutcsecond, int pageindex, int pagenum) {
        InterfaceIM.pbui_Type_MeetComplexQueryIM build = InterfaceIM.pbui_Type_MeetComplexQueryIM.newBuilder()
                .setQueryflag(queryflag)
                .setMsgtype(msgtype)
                .setRole(role)
                .setMemberid(memberid)
                .setStartutcsecond(startutcsecond)
                .setEndutcsecond(endutcsecond)
                .setPageindex(pageindex)
                .setPagenum(pagenum)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETIM.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_COMPLEXQUERY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                return InterfaceIM.pbui_TypePageResQueryrMsgInfo.parseFrom(bytes);
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    //</editor-fold>

    //<editor-fold desc="投票相关">

    //会议发起投票相关

    /**
     * 查询发起的投票
     *
     * @return 发起的投票
     */
    public InterfaceVote.pbui_Type_MeetOnVotingDetailInfo queryStartedVote() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceVote.pbui_Type_MeetOnVotingDetailInfo info = InterfaceVote.pbui_Type_MeetOnVotingDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询指定ID的发起的投票
     */
    public InterfaceVote.pbui_Item_MeetOnVotingDetailInfo queryStartedVoteById(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceVote.pbui_Type_MeetOnVotingDetailInfo info = InterfaceVote.pbui_Type_MeetOnVotingDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info.getItem(0);
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 新建一个投票
     */
    public void createVote(InterfaceVote.pbui_Item_MeetOnVotingDetailInfo item) {
        InterfaceVote.pbui_Type_MeetOnVotingDetailInfo build = InterfaceVote.pbui_Type_MeetOnVotingDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 新建一个投票
     */
    public void createVote(List<InterfaceVote.pbui_Item_MeetOnVotingDetailInfo> items) {
        InterfaceVote.pbui_Type_MeetOnVotingDetailInfo build = InterfaceVote.pbui_Type_MeetOnVotingDetailInfo.newBuilder()
                .addAllItem(items)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 修改一个投票
     */
    public void modifyVote(InterfaceVote.pbui_Item_MeetOnVotingDetailInfo item) {
        InterfaceVote.pbui_Type_MeetOnVotingDetailInfo build = InterfaceVote.pbui_Type_MeetOnVotingDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 发起投票
     */
    public void startVote(List<Integer> memberIds, int voteid, int seconds, int voteFlag) {
        InterfaceVote.pbui_ItemVoteStart build = InterfaceVote.pbui_ItemVoteStart.newBuilder()
                .addAllMemberid(memberIds)
                .setVoteflag(voteFlag)
                .setVoteid(voteid)
                .setTimeouts(seconds)
                .build();
        startVote(build);
    }

    /**
     * 发起投票
     */
    public void startVote(List<Integer> memberIds, int voteid, int seconds) {
        InterfaceVote.pbui_ItemVoteStart build = InterfaceVote.pbui_ItemVoteStart.newBuilder()
                .addAllMemberid(memberIds)
                .setVoteid(voteid)
                .setTimeouts(seconds)
                .setVoteflag(InterfaceMacro.Pb_VoteStartFlag.Pb_MEET_VOTING_FLAG_FINISHEXIT.getNumber())//默认投票全部被选后自动结束
                .build();
        startVote(build);
    }

    /**
     * 发起投票
     */
    public void startVote(InterfaceVote.pbui_ItemVoteStart item) {
        InterfaceVote.pbui_Type_MeetStartVoteInfo build = InterfaceVote.pbui_Type_MeetStartVoteInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_START.getNumber(), build.toByteArray());
    }

    /**
     * 删除投票
     */
    public void deleteVote(InterfaceVote.pbui_Item_MeetOnVotingDetailInfo item) {
        InterfaceVote.pbui_Type_MeetOnVotingDetailInfo build = InterfaceVote.pbui_Type_MeetOnVotingDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 删除投票
     */
    public void deleteVote(int voteId) {
        InterfaceVote.pbui_Type_MeetStopVoteInfo build = InterfaceVote.pbui_Type_MeetStopVoteInfo.newBuilder()
                .addVoteid(voteId)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 停止投票
     */
    public void stopVote(InterfaceVote.pbui_Item_MeetOnVotingDetailInfo item) {
        InterfaceVote.pbui_Type_MeetOnVotingDetailInfo build = InterfaceVote.pbui_Type_MeetOnVotingDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_STOP.getNumber(), build.toByteArray());
    }

    /**
     * 停止投票
     */
    public void stopVote(int voteId) {
        InterfaceVote.pbui_Type_MeetStopVoteInfo build = InterfaceVote.pbui_Type_MeetStopVoteInfo.newBuilder()
                .addVoteid(voteId)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_STOP.getNumber(), build.toByteArray());
    }

    /**
     * 提交投票结果
     *
     * @param selcnt  有效选项数
     * @param voteid  投票id
     * @param selitem 选择的项
     */
    public void submitVote(int selcnt, int voteid, int selitem) {
        submitVote(selcnt, voteid, selitem, "");
    }

    /**
     * 提交投票结果（2.0协议）
     *
     * @param selcnt  有效选项数
     * @param voteid  投票id
     * @param selitem 选择的项
     * @param mark    投票备注
     */
    public void submitVote(int selcnt, int voteid, int selitem, String mark) {
        InterfaceVote.pbui_Item_MeetSubmitVote build = InterfaceVote.pbui_Item_MeetSubmitVote.newBuilder()
                .setSelcnt(selcnt)
                .setVoteid(voteid)
                .setSelitem(selitem)
                .setMark(s2b(mark))
                .build();
        submitVote(build);
    }

    /**
     * 提交投票结果
     */
    public void submitVote(InterfaceVote.pbui_Item_MeetSubmitVote item) {
        InterfaceVote.pbui_Type_MeetSubmitVote build = InterfaceVote.pbui_Type_MeetSubmitVote.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SUBMIT.getNumber(), build.toByteArray());
    }

    /**
     * 设置投票超时值
     *
     * @param voteid   投票id
     * @param timeouts 单位秒
     */
    public void setVoteTime(int voteid, int timeouts) {
        InterfaceVote.pbui_Type_MeetSetVoteTimeouts build = InterfaceVote.pbui_Type_MeetSetVoteTimeouts.newBuilder()
                .setVoteid(voteid)
                .setTimeouts(timeouts)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SET.getNumber(), build.toByteArray());
    }

    /**
     * 查询指定id的投票
     *
     * @param id 投票id
     */
    public InterfaceVote.pbui_Item_MeetVoteDetailInfo queryVoteById(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETVOTEINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceVote.pbui_Type_MeetVoteDetailInfo info = InterfaceVote.pbui_Type_MeetVoteDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info.getItem(0);
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询投票
     *
     * @return
     */
    public InterfaceVote.pbui_Type_MeetVoteDetailInfo queryVote() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETVOTEINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceVote.pbui_Type_MeetVoteDetailInfo info = InterfaceVote.pbui_Type_MeetVoteDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 按类别查询投票
     *
     * @param maintype Pb_MeetVoteStatus、Pb_MeetVoteType、Pb_MeetVoteMode、Pb_MeetVote_SelType
     * @return
     */
    public InterfaceVote.pbui_Type_MeetVoteDetailInfo queryVoteByType(int maintype) {
        return queryVoteBy(InterfaceVote.Pb_VoteComplexFlag.Pb_VOTE_COMPLEX_FLAG_MAITYPE.getNumber(), maintype, 0, 0, 0);
    }

    /**
     * 按类别查询投票
     *
     * @param queryflag {@link InterfaceVote.Pb_VoteComplexFlag#Pb_VOTE_COMPLEX_FLAG_ZERO}
     * @param maintype  {@link InterfaceMacro.Pb_MeetVoteType#Pb_VOTE_MAINTYPE_vote}
     * @param mode      {@link InterfaceMacro.Pb_MeetVoteMode#Pb_VOTEMODE_agonymous}
     * @param type      {@link InterfaceMacro.Pb_MeetVote_SelType#Pb_VOTE_TYPE_MANY}
     * @param votestate {@link InterfaceMacro.Pb_MeetVoteStatus#Pb_vote_notvote}
     * @return {@link InterfaceVote.pbui_Type_MeetVoteDetailInfo}
     */
    public InterfaceVote.pbui_Type_MeetVoteDetailInfo queryVoteBy(int queryflag, int maintype
            , int mode, int type, int votestate) {
        InterfaceVote.pbui_Type_MeetVoteComplexQuery build = InterfaceVote.pbui_Type_MeetVoteComplexQuery.newBuilder()
                .setQueryflag(queryflag)
                .setMaintype(maintype)
                .setMode(mode)
                .setType(type)
                .setVotestate(votestate)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETVOTEINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_COMPLEXQUERY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceVote.pbui_Type_MeetVoteDetailInfo info = InterfaceVote.pbui_Type_MeetVoteDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    //会议投票记名相关

    /**
     * 查询指定投票的提交人
     *
     * @param id 投票id
     * @return 该投票的所有提交人
     */
    public InterfaceVote.pbui_Type_MeetVoteSignInDetailInfo queryVoteSubmitterById(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETVOTESIGNED.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceVote.pbui_Type_MeetVoteSignInDetailInfo info = InterfaceVote.pbui_Type_MeetVoteSignInDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询投票提交人属性
     *
     * @param propertyid Pb_MeetVotePropertyID
     * @param voteid     投票id
     * @param memberid   为0表示本身
     * @return InterfaceBase.pbui_CommonInt32uProperty
     */
    public InterfaceBase.pbui_CommonInt32uProperty queryVoteSubmitterAttribute(int propertyid, int voteid, int memberid) {
        InterfaceVote.pbui_Type_MeetVoteQueryProperty build = InterfaceVote.pbui_Type_MeetVoteQueryProperty.newBuilder()
                .setPropertyid(propertyid)
                .setVoteid(voteid)
                .setMemberid(memberid)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETVOTESIGNED.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERYPROPERTY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceBase.pbui_CommonInt32uProperty info = InterfaceBase.pbui_CommonInt32uProperty.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * //property id
     * <ul>
     *     <li>MEETNEWVOTE_PROPERTY_HADSIGNIN			    1 按投票ID\人员ID返回是否已经投票 query</li>
     *     <li>MEETNEWVOTE_PROPERTY_HADCHECKINNUM		    2 按投票ID\人员ID返回是否已经投票签到 query</li>
     *     <li>MEETNEWVOTE_PROPERTY_CHECKINNUM				3 按投票ID\返回投票实际签到总人数  query</li>
     *     <li>MEETNEWVOTE_PROPERTY_ATTENDNUM		        4 按投票ID\返回投票应到总人数  query</li>
     *     <li>MEETNEWVOTE_PROPERTY_VOTEDNUM		        5 按投票ID\返回投票已经投票总人数  query</li>
     * </ul>
     *
     * @param propertyid
     * @param voteid     新投票id
     * @param memberid   参会人id
     * @return {@link InterfaceBase.pbui_CommonInt32uProperty}
     */
    public InterfaceBase.pbui_CommonInt32uProperty queryNewVoteSubmitterAttribute(int propertyid, int voteid, int memberid) {
        InterfaceVote.pbui_Type_MeetNewVoteQueryProperty build = InterfaceVote.pbui_Type_MeetNewVoteQueryProperty.newBuilder()
                .setPropertyid(propertyid)
                .setVoteid(voteid)
                .setMemberid(memberid)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETNEWVOTESIGNED.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERYPROPERTY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceBase.pbui_CommonInt32uProperty info = InterfaceBase.pbui_CommonInt32uProperty.parseFrom(bytes);
                if (info != null) {
                    LogUtils.e("查询成功");
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        LogUtils.e("查询失败");
        return null;
    }

    //</editor-fold>

    //<editor-fold desc="新投票相关"/>

    /**
     * 查询投票
     *
     * @return {@link InterfaceVote.pbui_Type_MeetNewVoteDetailInfo}
     */
    public InterfaceVote.pbui_Type_MeetNewVoteDetailInfo queryNewVote() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETNEWVOTEINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                return InterfaceVote.pbui_Type_MeetNewVoteDetailInfo.parseFrom(bytes);
            } catch (InvalidProtocolBufferException e) {
                throw new RuntimeException(e);
            }
        }
        return null;
    }

    /**
     * 根据投票ID查询投票
     *
     * @return {@link InterfaceVote.pbui_Item_MeetNewVoteDetailInfo}
     */
    public InterfaceVote.pbui_Item_MeetNewVoteDetailInfo queryNewVoteById(int voteId) {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETNEWVOTEINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(),
                InterfaceBase.pbui_QueryInfoByID.newBuilder()
                        .setId(voteId)
                        .build().toByteArray());
        if (bytes != null) {
            try {
                InterfaceVote.pbui_Type_MeetNewVoteDetailInfo info = InterfaceVote.pbui_Type_MeetNewVoteDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info.getItem(0);
                }
            } catch (InvalidProtocolBufferException e) {
                throw new RuntimeException(e);
            }
        }
        return null;
    }

    /**
     * 查询指定类型的投票
     *
     * @param queryflag
     * @param maintype  {@link InterfaceMacro.Pb_MeetVoteType}
     * @param mode      {@link InterfaceMacro.Pb_MeetVoteMode}
     * @param seltype   {@link InterfaceMacro.Pb_MeetVote_SelType}
     * @param votestate {@link InterfaceMacro.Pb_MeetVoteStatus}
     * @return {@link InterfaceVote.pbui_Type_MeetNewVoteDetailInfo}
     */
    public InterfaceVote.pbui_Type_MeetNewVoteDetailInfo queryNewVoteByType(int queryflag, int maintype, int mode, int seltype, int votestate) {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETNEWVOTEINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_COMPLEXQUERY.getNumber(),
                InterfaceVote.pbui_Type_MeetNewVoteComplexQuery.newBuilder()
                        .setQueryflag(queryflag)
                        .setMaintype(maintype)
                        .setMode(mode)
                        .setSeltype(seltype)
                        .setVotestate(votestate)
                        .build().toByteArray());
        if (bytes != null) {
            try {
                return InterfaceVote.pbui_Type_MeetNewVoteDetailInfo.parseFrom(bytes);
            } catch (InvalidProtocolBufferException e) {
                throw new RuntimeException(e);
            }
        }
        return null;
    }

    public void startNewVote(List<Integer> memberIds, int voteId, int timeouts, int voteflag) {
        ArrayList<Integer> ids = new ArrayList<>();
        ids.add(voteId);
        startNewVote(memberIds, ids, timeouts, voteflag);
    }

    public void startNewVote(List<Integer> memberIds, List<Integer> voteIds, int timeouts, int voteflag) {
        LogUtils.i("发起新投票 memberIds=" + memberIds + ",voteIds=" + voteIds);
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONNEWVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_START.getNumber(),
                InterfaceVote.pbui_Type_MeetStartNewVoteInfo.newBuilder()
                        .addAllMembers(memberIds)
                        .addAllVoteid(voteIds)
                        .setVoteflag(voteflag)
                        .setTimeouts(timeouts)
                        .build().toByteArray());
    }

    public void stopNewVote(int voteId) {
        ArrayList<Integer> ids = new ArrayList<>();
        ids.add(voteId);
        stopNewVote(ids);
    }

    public void stopNewVote(List<Integer> voteIds) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONNEWVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_STOP.getNumber(),
                InterfaceVote.pbui_Type_MeetStopNewVoteInfo.newBuilder()
                        .addAllVoteid(voteIds)
                        .build().toByteArray());
    }

    public void createNewVote(InterfaceVote.pbui_Item_MeetOnNewVotingDetailInfo item) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONNEWVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(),
                InterfaceVote.pbui_Type_MeetOnNewVotingDetailInfo.newBuilder()
                        .addItem(item)
                        .build().toByteArray());
    }

    public void createNewVote(List<InterfaceVote.pbui_Item_MeetOnNewVotingDetailInfo> items) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONNEWVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(),
                InterfaceVote.pbui_Type_MeetOnNewVotingDetailInfo.newBuilder()
                        .addAllItem(items)
                        .build().toByteArray());
    }

    public void modifyNewVote(InterfaceVote.pbui_Item_MeetOnNewVotingDetailInfo item) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONNEWVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(),
                InterfaceVote.pbui_Type_MeetOnNewVotingDetailInfo.newBuilder()
                        .addItem(item)
                        .build().toByteArray());
    }

    public void deleteNewVote(List<Integer> voteIds) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONNEWVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(),
                InterfaceVote.pbui_Type_MeetStopNewVoteInfo.newBuilder()
                        .addAllVoteid(voteIds)
                        .build().toByteArray());
    }

    /**
     * 推送投票结果
     *
     * @param orderid {@link InterfaceVote.Pb_NewVoteOrderId}
     * @param json    {"meetid":1,"voteid":[1,2,3]} //voteid 为空表示全部投票
     */
    public void pushNewVote(int orderid, String json) {
        LogUtils.i("推送投票结果：orderid=" + orderid + ",json=" + json);
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONNEWVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_PUSH.getNumber(),
                InterfaceVote.pbui_Type_MeetNotifyPushNewVoteInfo.newBuilder()
                        .setOrderid(orderid)
                        .setPjson(s2b(json))
                        .build().toByteArray());
    }

    public void submitNewVote(InterfaceVote.pbui_Item_MeetSubmitNewVote item) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETONNEWVOTING.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SUBMIT.getNumber(),
                InterfaceVote.pbui_Type_MeetSubmitNewVote.newBuilder().addItem(item).build().toByteArray());
    }

    /**
     * 查询指定投票的提交人
     *
     * @param queryflag NEWVOTE_QUERYFLAG_JSON 0x00000001 需要返回json，NEWVOTE_QUERYFLAG_PNG  0x00000002 需要返回png
     * @param voteId    投票id
     * @param item      {@link InterfaceVote.pbui_Type_MeetNewVoteSignInDetailInfo}、{@link InterfaceVote.pbui_Item_MeetNewVoteSignInDetailInfo}
     */
    public InterfaceVote.pbui_Type_MeetNewVoteSignInDetailInfo queryNewVoteSubmitterById(int voteId) {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETNEWVOTESIGNED.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(),
                InterfaceVote.pbui_Type_MeetNewVoteSignInDetailInfo.newBuilder()
                        .setQueryflag(3)//=1 表示需要json,=2表示需要签名图
                        .setVoteid(voteId)
                        .build().toByteArray());
        if (bytes != null) {
            try {
                return InterfaceVote.pbui_Type_MeetNewVoteSignInDetailInfo.parseFrom(bytes);
            } catch (InvalidProtocolBufferException e) {
                throw new RuntimeException(e);
            }
        }
        return null;
    }

    //</editor-fold>

    //<editor-fold desc="会议签到相关"/>

    /**
     * 查询指定人员的签到
     * Pb_MeetSignType
     *
     * @param id 人员id
     */
    public InterfaceSignin.pbui_Item_MeetSignInDetailInfo querySignInById(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETSIGN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceSignin.pbui_Type_MeetSignInDetailInfo info = InterfaceSignin.pbui_Type_MeetSignInDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info.getItem(0);
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询签到
     *
     * @return
     */
    public InterfaceSignin.pbui_Type_MeetSignInDetailInfo querySignIn() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETSIGN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceSignin.pbui_Type_MeetSignInDetailInfo info = InterfaceSignin.pbui_Type_MeetSignInDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 删除签到
     *
     * @param meetingId 指定会议ID 0表示绑定的会议
     * @param memberId  人员id 为空表示删除指定会议的全部人员签到
     */
    public void deleteSignIn(int meetingId, int memberId) {
        InterfaceSignin.pbui_Type_DoDeleteMeetSignIno build = InterfaceSignin.pbui_Type_DoDeleteMeetSignIno.newBuilder()
                .setMeetingid(meetingId)
                .addMemberids(memberId)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETSIGN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 删除签到
     *
     * @param meetingId 指定会议ID 0表示绑定的会议
     * @param memberIds 人员id 为空表示删除指定会议的全部人员签到
     */
    public void deleteSignIn(int meetingId, List<Integer> memberIds) {
        InterfaceSignin.pbui_Type_DoDeleteMeetSignIno build = InterfaceSignin.pbui_Type_DoDeleteMeetSignIno.newBuilder()
                .setMeetingid(meetingId)
                .addAllMemberids(memberIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETSIGN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    public void signInDirect() {
        signIn(0, InterfaceMacro.Pb_MeetSignType.Pb_signin_direct.getNumber(), "", s2b(""));
    }

    /**
     * 发送签到
     * Pb_MeetSignType
     *
     * @param memberid  指定签到的人员ID,为0表示当前绑定的人员
     * @param type      签到方式 参见 Pb_MeetSignType
     * @param password  签到密码
     * @param psigndata 如果有图片签到则为png图片数据(二进制转hex编码)
     */
    public void signIn(int memberid, int type, String password, ByteString psigndata) {
        InterfaceSignin.pbui_Type_DoMeetSignIno build = InterfaceSignin.pbui_Type_DoMeetSignIno.newBuilder()
                .setMemberid(memberid)
                .setSigninType(type)
                .setPassword(s2b(password))
                .setPsigndata(psigndata)
                .build();
        LogUtils.v(TAG, "signIn 签到信息：memberid=" + memberid + ",type=" + type + ",password=" + password + ",psigndata=" + psigndata.size());
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETSIGN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 查询会议签到属性
     *
     * @param propertyid    Pb_MeetSignPropertyID
     * @param parameterval
     * @param parameterval2
     */
    public int querySignInAttribute(int propertyid, int parameterval, int parameterval2) {
        InterfaceBase.pbui_CommonQueryProperty build = InterfaceBase.pbui_CommonQueryProperty.newBuilder()
                .setPropertyid(propertyid)
                .setParameterval(parameterval)
                .setParameterval2(parameterval2)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETSIGN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERYPROPERTY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceBase.pbui_CommonInt32uProperty info = InterfaceBase.pbui_CommonInt32uProperty.parseFrom(bytes);
                if (info != null) {
                    return info.getPropertyval();
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return -1;
    }

    //</editor-fold>

    //<editor-fold desc="会议白板相关">

    /**
     * 白板控制操作（发起、关闭、退出）
     *
     * @param operflag     指定操作标志 参见 Pb_MeetPostilOperType
     * @param medianame    白板操作描述
     * @param opermemberid 当前该命令的人员ID
     * @param srcmemid     发起人的人员ID 白板标识使用
     * @param srcwbid      发起人的白板标识 取微秒级的时间作标识 白板标识使用
     * @param memberIds    参会人员id
     */
    public void whiteBoardControl(int operflag, String medianame, int opermemberid, int srcmemid, long srcwbid, List<Integer> memberIds) {
        InterfaceWhiteboard.pbui_Type_MeetWhiteBoardControl build = InterfaceWhiteboard.pbui_Type_MeetWhiteBoardControl.newBuilder()
                .setOperflag(operflag)
                .setMedianame(s2b(medianame))
                .setOpermemberid(opermemberid)
                .setSrcmemid(srcmemid)
                .setSrcwbid(srcwbid)
                .addAllUserid(memberIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_WHITEBOARD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_CONTROL.getNumber(), build.toByteArray());
    }

    /**
     * 拒绝加入/同意加入
     *
     * @param opermemberid 当前该命令的人员ID
     * @param srcmemid     发起人的人员ID 白板标识使用
     * @param srcwbid      发起人的白板标识 取微秒级的时间作标识 白板标识使用
     * @param isReject     =true拒绝,=false同意
     */
    public void whiteBoardOperation(int opermemberid, int srcmemid, long srcwbid, boolean isReject) {
        InterfaceWhiteboard.pbui_Type_MeetWhiteBoardOper build = InterfaceWhiteboard.pbui_Type_MeetWhiteBoardOper.newBuilder()
                .setOpermemberid(opermemberid)
                .setSrcmemid(srcmemid)
                .setSrcwbid(srcwbid)
                .build();
        int method = isReject ? InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_REJECT.getNumber()
                : InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ENTER.getNumber();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_WHITEBOARD.getNumber(),
                method, build.toByteArray());
    }

    /**
     * 白板清空记录
     * fixed32  memberid=1;   //需要删除的人员ID 为0表示清除所有等于人员的白板操作
     * fixed32  operid=2;	    //操作ID 终端计算产生 为0表示清除所有等于opermemberid的白板操作
     * <p>
     * fixed32  opermemberid=3;//当前该命令的人员ID
     * fixed32  srcmemid=4;//发起人的人员ID 白板标识使用
     * fixed64  srcwbid=5;//发起人的白板标识 取微秒级的时间作标识 白板标识使用
     * <p>
     * fixed64  utcstamp=6;	//时间戳 微秒
     * fixed32  figuretype=7;	//图形类型 为0表示清除所有类型的白板操作 Pb_MeetPostilFigureType
     */
    public void whiteBoardDelAll(int memberid, int operid, int opermemberid, int srcmemid, long srcwbid, long utcstamp, int figuretype) {
        InterfaceWhiteboard.pbui_Type_MeetDoClearWhiteBoard build = InterfaceWhiteboard.pbui_Type_MeetDoClearWhiteBoard.newBuilder()
                .setMemberid(memberid)
                .setOperid(operid)
                .setOpermemberid(opermemberid)
                .setSrcmemid(srcmemid)
                .setSrcwbid(srcwbid)
                .setUtcstamp(utcstamp)
                .setFiguretype(figuretype)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_WHITEBOARD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DELALL.getNumber(), build.toByteArray());
    }

    /**
     * 白板删除记录
     * <p>
     * fixed32  memberid=1;   //需要删除的人员ID 为0表示清除所有等于人员的白板操作
     * fixed32  operid=2;	    //操作ID 终端计算产生 为0表示清除所有等于opermemberid的白板操作
     * <p>
     * fixed32  opermemberid=3;//当前该命令的人员ID
     * fixed32  srcmemid=4;//发起人的人员ID 白板标识使用
     * fixed64  srcwbid=5;//发起人的白板标识 取微秒级的时间作标识 白板标识使用
     * <p>
     * fixed64  utcstamp=6;	//时间戳 微秒
     * fixed32  figuretype=7;	//图形类型 为0表示清除所有类型的白板操作 Pb_MeetPostilFigureType
     */
    public void whiteBoardDel(int memberid, int operid, int opermemberid, int srcmemid, long srcwbid, long utcstamp, int figuretype) {
        InterfaceWhiteboard.pbui_Type_MeetDoClearWhiteBoard build = InterfaceWhiteboard.pbui_Type_MeetDoClearWhiteBoard.newBuilder()
                .setMemberid(memberid)
                .setOperid(operid)
                .setOpermemberid(opermemberid)
                .setSrcmemid(srcmemid)
                .setSrcwbid(srcwbid)
                .setUtcstamp(utcstamp)
                .setFiguretype(figuretype)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_WHITEBOARD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 添加墨迹
     * fixed32  operid=1;	    //操作ID 终端计算产生 为0表示清除所有等于opermemberid的白板操作
     * fixed32  opermemberid=2;//当前该命令的人员ID 为0表示清除所有等于opermemberid的白板操作
     * fixed32  srcmemid=3;//发起人的人员ID 白板标识使用
     * fixed64  srcwbid=4;//发起人的白板标识 取微秒级的时间作标识 白板标识使用
     * fixed64  utcstamp=5;	//时间戳  微秒
     * fixed32  figuretype=6;	//图形类型 为0表示清除所有等于figuretype的白板操作
     * fixed32  linesize=7;			//线条宽度
     * fixed32  Argb=8;			//线条颜色
     * repeated float pinklist=9; //ink point Num, float[2 * ptnum](x,y依次排列)
     */
    public void drawInk(int operid, int opermemberid, int srcmemid, long srcwbid
            , long utcstamp, int figuretype, int linesize, int argb, List<PointF> allpinklist) {
        InterfaceWhiteboard.pbui_Type_MeetWhiteBoardInkItem.Builder builder = InterfaceWhiteboard.pbui_Type_MeetWhiteBoardInkItem.newBuilder();
        builder.setOperid(operid)
                .setOpermemberid(opermemberid)
                .setSrcmemid(srcmemid)
                .setSrcwbid(srcwbid)
                .setUtcstamp(utcstamp)
                .setFiguretype(figuretype)
                .setLinesize(linesize)
                .setArgb(argb);
        for (int i = 0; i < allpinklist.size(); i++) {
            builder.addPinklist(allpinklist.get(i).x);
            builder.addPinklist(allpinklist.get(i).y);
        }
        InterfaceWhiteboard.pbui_Type_MeetWhiteBoardInkItem build = builder.build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_WHITEBOARD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADDINK.getNumber(), build.toByteArray());
    }

    /**
     * 查询墨迹
     * fixed32  srcmemid=1;//发起人的人员ID 白板标识使用
     * fixed64  srcwbid=2;//发起人的白板标识 取微秒级的时间作标识 白板标识使用
     * fixed32  figuretype=3;	//图形类型 必须指定一种类型,因为不同类型结构不同,不好解析,所以要按类型查询
     * fixed32  opermemberid=4;//人员ID
     *
     * @return List<InterfaceWhiteboard.pbui_Item_MeetWBInkDetail>
     */
    public InterfaceWhiteboard.pbui_Type_MeetWBInkDetail queryDrawInk(int opermemberid, int srcmemid, long srcwbid, int figuretype) {
        InterfaceWhiteboard.pbui_Type_MeetWhiteBoardComplexQuery build = InterfaceWhiteboard.pbui_Type_MeetWhiteBoardComplexQuery.newBuilder()
                .setOpermemberid(opermemberid)
                .setSrcmemid(srcmemid)
                .setSrcwbid(srcwbid)
                .setFiguretype(figuretype)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_WHITEBOARD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceWhiteboard.pbui_Type_MeetWBInkDetail info = InterfaceWhiteboard.pbui_Type_MeetWBInkDetail.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 添加矩形、直线、圆形
     * fixed32  operid=1;	    //操作ID 终端计算产生 为0表示清除所有等于opermemberid的白板操作
     * fixed32  opermemberid=2;//当前该命令的人员ID 为0表示清除所有等于opermemberid的白板操作
     * fixed32  srcmemid=3;//发起人的人员ID 白板标识使用
     * fixed64  srcwbid=4;//发起人的白板标识 取微秒级的时间作标识 白板标识使用
     * <p>
     * fixed64  utcstamp=5;	//时间戳  微秒
     * fixed32  figuretype=6;	//图形类型 为0表示清除所有等于figuretype的白板操作
     * <p>
     * fixed32  linesize=7;			//线条宽度
     * fixed32  Argb=8;			//线条颜色
     * repeated float pt=9;		    //(lx,ly,rx,ry 左上角,右下角坐标)
     */
    public void drawRect(int operid, int opermemberid, int srcmemid, long srcwbid, long utcstamp
            , int figuretype, int linesize, int arge, List<Float> pt) {
        InterfaceWhiteboard.pbui_Item_MeetWBRectDetail build = InterfaceWhiteboard.pbui_Item_MeetWBRectDetail.newBuilder()
                .setOperid(operid)
                .setOpermemberid(opermemberid)
                .setSrcmemid(srcmemid)
                .setSrcwbid(srcwbid)
                .setUtcstamp(utcstamp)
                .setFiguretype(figuretype)
                .setLinesize(linesize)
                .setArgb(arge)
                .addAllPt(pt)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_WHITEBOARD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADDRECT.getNumber(), build.toByteArray());
    }

    /**
     * 查询矩形、直线、圆形
     * fixed32  srcmemid=1;//发起人的人员ID 白板标识使用
     * fixed64  srcwbid=2;//发起人的白板标识 取微秒级的时间作标识 白板标识使用
     * fixed32  figuretype=3;	//图形类型 必须指定一种类型,因为不同类型结构不同,不好解析,所以要按类型查询
     * <p>
     * fixed32  opermemberid=4;//人员ID
     *
     * @return List<InterfaceWhiteboard.pbui_Item_MeetWBRectDetail>
     */
    public InterfaceWhiteboard.pbui_Type_MeetWBRectDetail queryDrawRect(int opermemberid, int srcmemid, long srcwbid, int figuretype) {
        InterfaceWhiteboard.pbui_Type_MeetWhiteBoardComplexQuery build = InterfaceWhiteboard.pbui_Type_MeetWhiteBoardComplexQuery.newBuilder()
                .setOpermemberid(opermemberid)
                .setSrcmemid(srcmemid)
                .setSrcwbid(srcwbid)
                .setFiguretype(figuretype)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_WHITEBOARD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceWhiteboard.pbui_Type_MeetWBRectDetail info = InterfaceWhiteboard.pbui_Type_MeetWBRectDetail.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 添加文本
     * fixed32  operid=1;	    //操作ID 终端计算产生 为0表示清除所有等于opermemberid的白板操作
     * fixed32  opermemberid=2;//当前该命令的人员ID 为0表示清除所有等于opermemberid的白板操作
     * fixed32  srcmemid=3;//发起人的人员ID 白板标识使用
     * fixed64  srcwbid=4;//发起人的白板标识 取微秒级的时间作标识 白板标识使用
     * <p>
     * fixed64  utcstamp=5;	//时间戳  微秒
     * fixed32  figuretype=6;	//图形类型 为0表示清除所有等于figuretype的白板操作
     * <p>
     * fixed32  fontsize=7;			//字体大小
     * fixed32  fontflag=8;			//字体其它属性
     * fixed32  Argb=9;				//字体颜色
     * bytes    fontname=10; //字体名称
     * float    lx=11;				//(lx,ly,左上角坐标)
     * float    ly=12;				//(lx,ly,左上角坐标)
     * bytes    ptext=13;
     */
    public void drawText(int operid, int opermemberid, int srcmemid, long srcwbid, long utcstamp
            , int figuretype, int fontsize, int fontflag, int arge, String fontname, float lx, float ly, String text) {
        InterfaceWhiteboard.pbui_Item_MeetWBTextDetail build = InterfaceWhiteboard.pbui_Item_MeetWBTextDetail.newBuilder()
                .setOperid(operid)
                .setOpermemberid(opermemberid)
                .setSrcmemid(srcmemid)
                .setSrcwbid(srcwbid)
                .setUtcstamp(utcstamp)
                .setFiguretype(figuretype)
                .setFontsize(fontsize)
                .setFontflag(fontflag)
                .setArgb(arge)
                .setFontname(s2b(fontname))
                .setLx(lx)
                .setLy(ly)
                .setPtext(s2b(text))
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_WHITEBOARD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADDTEXT.getNumber(), build.toByteArray());
    }

    /**
     * 查询绘制的文本
     * <p>
     * fixed32  srcmemid=1;//发起人的人员ID 白板标识使用
     * fixed64  srcwbid=2;//发起人的白板标识 取微秒级的时间作标识 白板标识使用
     * fixed32  figuretype=3;	//图形类型 必须指定一种类型,因为不同类型结构不同,不好解析,所以要按类型查询
     * <p>
     * fixed32  opermemberid=4;//人员ID
     *
     * @return
     */
    public InterfaceWhiteboard.pbui_Type_MeetWBTextDetail queryDrawText(int opermemberid, int srcmemid, long srcwbid, int figuretype) {
        InterfaceWhiteboard.pbui_Type_MeetWhiteBoardComplexQuery build = InterfaceWhiteboard.pbui_Type_MeetWhiteBoardComplexQuery.newBuilder()
                .setOpermemberid(opermemberid)
                .setSrcmemid(srcmemid)
                .setSrcwbid(srcwbid)
                .setFiguretype(figuretype)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_WHITEBOARD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceWhiteboard.pbui_Type_MeetWBTextDetail info = InterfaceWhiteboard.pbui_Type_MeetWBTextDetail.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 绘制图片
     * fixed32  operid=1;	    //操作ID 终端计算产生 为0表示清除所有等于opermemberid的白板操作
     * fixed32  opermemberid=2;//当前该命令的人员ID 为0表示清除所有等于opermemberid的白板操作
     * fixed32  srcmemid=3;//发起人的人员ID 白板标识使用
     * fixed64  srcwbid=4;//发起人的白板标识 取微秒级的时间作标识 白板标识使用
     * <p>
     * fixed64  utcstamp=5;	//时间戳  微秒
     * fixed32  figuretype=6;	//图形类型 为0表示清除所有等于figuretype的白板操作
     * <p>
     * float    lx=7;				//(lx,ly,左上角坐标)
     * float    ly=8;				//(lx,ly,左上角坐标)
     * <p>
     * bytes  picdata=9;//png图片数据(二进制转hex编码)
     */
    public void drawPicture(int operid, int opermemberid, int srcmemid, long srcwbid, long utcstamp
            , int figuretype, float lx, float ly, ByteString picdata) {
        InterfaceWhiteboard.pbui_Item_MeetWBPictureDetail build = InterfaceWhiteboard.pbui_Item_MeetWBPictureDetail.newBuilder()
                .setOperid(operid)
                .setOpermemberid(opermemberid)
                .setSrcmemid(srcmemid)
                .setSrcwbid(srcwbid)
                .setUtcstamp(utcstamp)
                .setFiguretype(figuretype)
                .setLx(lx)
                .setLy(ly)
                .setPicdata(picdata)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_WHITEBOARD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADDPICTURE.getNumber(), build.toByteArray());
    }

    /**
     * 查询绘制图片
     * fixed32  srcmemid=1;//发起人的人员ID 白板标识使用
     * fixed64  srcwbid=2;//发起人的白板标识 取微秒级的时间作标识 白板标识使用
     * fixed32  figuretype=3;	//图形类型 必须指定一种类型,因为不同类型结构不同,不好解析,所以要按类型查询
     * <p>
     * fixed32  opermemberid=4;//人员ID
     *
     * @return
     */
    public InterfaceWhiteboard.pbui_Type_MeetWBPictureDetail queryDrawPicture(int opermemberid, int srcmemid, long srcwbid, int figuretype) {
        InterfaceWhiteboard.pbui_Type_MeetWhiteBoardComplexQuery build = InterfaceWhiteboard.pbui_Type_MeetWhiteBoardComplexQuery.newBuilder()
                .setOpermemberid(opermemberid)
                .setSrcmemid(srcmemid)
                .setSrcwbid(srcwbid)
                .setFiguretype(figuretype)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_WHITEBOARD.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceWhiteboard.pbui_Type_MeetWBPictureDetail info = InterfaceWhiteboard.pbui_Type_MeetWBPictureDetail.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    //</editor-fold>

    //<editor-fold desc="会议功能配置相关">

    /**
     * 修改会议功能
     * fixed32   modifyflag =0修改的是当前会议的，=1修改的是全局默认的  参见Pb_FunCon_ModifyFlag
     * repeated pbui_Item_MeetFunConfigDetailInfo item=2;
     */
    public void modifyMeetFunction(int modifyflag, List<InterfaceMeetfunction.pbui_Item_MeetFunConfigDetailInfo> items) {
        InterfaceMeetfunction.pbui_Type_MeetFunConfigDetailInfo build = InterfaceMeetfunction.pbui_Type_MeetFunConfigDetailInfo.newBuilder()
                .setModifyflag(modifyflag)
                .addAllItem(items)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_FUNCONFIG.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SAVE.getNumber(), build.toByteArray());
    }

    /**
     * 查询会议功能
     *
     * @return
     */
    public InterfaceMeetfunction.pbui_Type_MeetFunConfigDetailInfo queryMeetFunction() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_FUNCONFIG.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceMeetfunction.pbui_Type_MeetFunConfigDetailInfo info = InterfaceMeetfunction.pbui_Type_MeetFunConfigDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    //</editor-fold>

    // 远程桌面控制相关

    /**
     * 鼠标操作
     * fixed32  flag=1;			//控制的标志  参考streamcontrol.h 定义
     * fixed32  deviceid=2;       //设备ID
     * float   x=3; //x / width的百分比
     * float   y=4; //y / height的百分比
     */
    public void mouseOperation(int flag, int deviceId, float x, float y) {
        InterfaceStream.pbui_Type_MeetDoScreenMouseControl build = InterfaceStream.pbui_Type_MeetDoScreenMouseControl.newBuilder()
                .setFlag(flag)
                .setDeviceid(deviceId)
                .setX(x)
                .setY(y)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_SCREENMOUSECONTROL.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_CONTROL.getNumber(), build.toByteArray());
    }

    /**
     * 键盘操作
     * fixed32  flag=1;			//控制的标志 参考streamcontrol.h 定义
     * fixed32  deviceid=2;       //发起请求的设备ID
     * fixed32  memberid=3;       //发起请求的人员ID
     * <p>
     * fixed32  otherflag=4; //参考streamcontrol.h 定义
     * fixed32  key=5; //对应的key值 参考streamcontrol.h 定义
     */
    public void KeyboardOperation(int flag, int deviceId, int otherFlag, int key) {
        InterfaceStream.pbui_Type_MeetDoScreenKeyBoardControl build = InterfaceStream.pbui_Type_MeetDoScreenKeyBoardControl.newBuilder()
                .setFlag(flag)
                .setDeviceid(deviceId)
                .setOtherflag(otherFlag)
                .setKey(key)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_SCREENMOUSECONTROL.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_CONTROL.getNumber(), build.toByteArray());
    }

    //停止播放操作相关

    /**
     * 停止资源操作
     * fixed32   playflag=1;//播放标志 参见Interface_Macro.proto Pb_MeetPlayFlag
     * fixed32   triggeruserval=2;//参见Interface_Macro.proto文件中的Pb_TriggerUsedef定义
     * repeated fixed32 res=3;//有效资源个数,为空表示全部 初始化播放资源时传入的资源ID eg:0,1,2,3 etc
     * repeated fixed32 deviceid=4;//通知的目标设备,为空表示全部
     */
    public void stopResource(int playflag, int triggeruserval, List<Integer> resIds, List<Integer> devIds) {
        InterfaceStop.pbui_Type_MeetDoStopResWork build = InterfaceStop.pbui_Type_MeetDoStopResWork.newBuilder()
                .setPlayflag(playflag)
                .setTriggeruserval(triggeruserval)
                .addAllRes(resIds)
                .addAllDeviceid(devIds)
                .build();
        try {
            throw new Exception("停止资源 resIds=" + resIds + ",devIds=" + devIds);
        } catch (Exception e) {
            LogUtils.e(e);
        }
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_STOPPLAY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_CLOSE.getNumber(), build.toByteArray());
    }

    public void stopResource(int playflag, int triggeruserval, @ResId int resId, List<Integer> devIds) {
        List<Integer> resIds = new ArrayList<>();
        resIds.add(resId);
        stopResource(playflag, triggeruserval, resIds, devIds);
    }

    public void stopResource(int playflag, int triggeruserval, List<Integer> resIds, int devId) {
        List<Integer> devIds = new ArrayList<>();
        devIds.add(devId);
        stopResource(playflag, triggeruserval, resIds, devIds);
    }

    public void stopResource(int playflag, int triggeruserval, @ResId int resId, int devId) {
        List<Integer> resIds = new ArrayList<>();
        resIds.add(resId);
        List<Integer> devIds = new ArrayList<>();
        devIds.add(devId);
        stopResource(playflag, triggeruserval, resIds, devIds);
    }

    // 媒体播放操作相关

    /**
     * 初始化播放资源
     *
     * @param w     宽
     * @param h     高
     * @param resId 资源id
     */
    public void initialRes(int w, int h, @ResId int resId) {
        InterfacePlaymedia.pbui_Type_MeetInitPlayRes build = InterfacePlaymedia.pbui_Type_MeetInitPlayRes.newBuilder()
                .setW(w)
                .setH(h)
                .setRes(resId)
                .setX(0)
                .setY(0)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEDIAPLAY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_INIT.getNumber(), build.toByteArray());
    }

    /**
     * 释放播放资源
     *
     * @param resId 资源id
     */
    public void releaseRes(@ResId int resId) {
        InterfacePlaymedia.pbui_Type_MeetDestroyPlayRes build = InterfacePlaymedia.pbui_Type_MeetDestroyPlayRes.newBuilder()
                .setRes(resId)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEDIAPLAY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DESTORY.getNumber(), build.toByteArray());
    }

    /**
     * 媒体播放
     * fixed32  playflag=1;//播放标志 参见Interface_Macro.proto Pb_MeetPlayFlag
     * <p>
     * fixed32  pos=2;//指定开始播放的百分比位置
     * fixed32  mediaid=3;//媒体ID
     * fixed32  triggeruserval=4;//参见Interface_Macro.proto文件中的Pb_TriggerUsedef定义
     * <p>
     * repeated fixed32 res=5;//有效资源个数,为空表示全部 初始化播放资源时传入的资源ID eg:0,1,2,3 etc
     * repeated fixed32 deviceid=6;//通知的目标设备,为空表示全部
     */
    public void mediaPlay(int playflag, int pos, int mediaid, int triggeruserval, List<Integer> resIds, List<Integer> devIds) {
        InterfacePlaymedia.pbui_Type_MeetDoMediaPlay build = InterfacePlaymedia.pbui_Type_MeetDoMediaPlay.newBuilder()
                .setPlayflag(playflag)
                .setPos(pos)
                .setMediaid(mediaid)
                .setTriggeruserval(triggeruserval)
                .addAllRes(resIds)
                .addAllDeviceid(devIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEDIAPLAY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_START.getNumber(), build.toByteArray());
    }

    public void mediaPlay(int playflag, int pos, int mediaid, int triggeruserval, @ResId int resId, List<Integer> devIds) {
        InterfacePlaymedia.pbui_Type_MeetDoMediaPlay build = InterfacePlaymedia.pbui_Type_MeetDoMediaPlay.newBuilder()
                .setPlayflag(playflag)
                .setPos(pos)
                .setMediaid(mediaid)
                .setTriggeruserval(triggeruserval)
                .addRes(resId)
                .addAllDeviceid(devIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEDIAPLAY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_START.getNumber(), build.toByteArray());
    }

    public void mediaPlay(int playflag, int pos, int mediaid, int triggeruserval, @ResId int resId, int devId) {
        InterfacePlaymedia.pbui_Type_MeetDoMediaPlay build = InterfacePlaymedia.pbui_Type_MeetDoMediaPlay.newBuilder()
                .setPlayflag(playflag)
                .setPos(pos)
                .setMediaid(mediaid)
                .setTriggeruserval(triggeruserval)
                .addRes(resId)
                .addDeviceid(devId)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEDIAPLAY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_START.getNumber(), build.toByteArray());
    }

    /**
     * 设置播放位置
     * fixed32   resindex=1;//资源索引号 初始化播放资源时传入的资源ID eg:0,1,2,3 etc
     * fixed32   pos=2;//指定开始播放的百分比位置
     * fixed32   playflag=3;//播放标志 参见Interface_Macro.proto Pb_MeetPlayFlag
     * fixed32   triggeruserval=4;//参见Interface_Macro.proto文件中的Pb_TriggerUsedef定义
     * repeated fixed32 deviceid=5;//通知的目标设备,为空表示全部
     */
    public void setPlayPos(@ResId int resId, int pos, int playflag, int triggeruserval, List<Integer> devIds) {
        InterfacePlaymedia.pbui_Type_MeetDoSetPlayPos build = InterfacePlaymedia.pbui_Type_MeetDoSetPlayPos.newBuilder()
                .setResindex(resId)
                .setPos(pos)
                .setPlayflag(playflag)
                .setTriggeruserval(triggeruserval)
                .addAllDeviceid(devIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEDIAPLAY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MOVE.getNumber(), build.toByteArray());
    }

    /**
     * 设置播放暂停
     */
    public void setPlayPause(int resIndex, int devId) {
        InterfacePlaymedia.pbui_Type_MeetDoPlayControl.Builder builder = InterfacePlaymedia.pbui_Type_MeetDoPlayControl.newBuilder();
        builder.setResindex(resIndex);
        builder.addDeviceid(devId);
        InterfacePlaymedia.pbui_Type_MeetDoPlayControl build = builder.build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEDIAPLAY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_PAUSE.getNumber(), build.toByteArray());
        LogUtils.e(TAG, "setPlayStop:  设置播放暂停 --->>> ");
    }

    /**
     * 设置播放暂停
     */
    public void setPlayPause(int resIndex, List<Integer> devIds) {
        InterfacePlaymedia.pbui_Type_MeetDoPlayControl.Builder builder = InterfacePlaymedia.pbui_Type_MeetDoPlayControl.newBuilder();
        builder.setResindex(resIndex);
        builder.addAllDeviceid(devIds);
        InterfacePlaymedia.pbui_Type_MeetDoPlayControl build = builder.build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEDIAPLAY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_PAUSE.getNumber(), build.toByteArray());
        LogUtils.e(TAG, "setPlayStop:  设置播放暂停 --->>> ");
    }

    /**
     * 设置播放回复
     */
    public void setPlayRecover(int resIndex, List<Integer> devIds) {
        InterfacePlaymedia.pbui_Type_MeetDoPlayControl.Builder builder = InterfacePlaymedia.pbui_Type_MeetDoPlayControl.newBuilder();
        builder.setResindex(resIndex);
        builder.addAllDeviceid(devIds);
        InterfacePlaymedia.pbui_Type_MeetDoPlayControl build = builder.build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEDIAPLAY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_PLAY.getNumber(), build.toByteArray());
        LogUtils.e(TAG, "setPlayRecover:  设置播放恢复 --->>> ");
    }

    /**
     * 设置播放暂停
     * fixed32  resindex=1;//资源索引号 初始化播放资源时传入的资源ID eg:0,1,2,3 etc
     * fixed32  playflag=2;//播放标志 参见Interface_Macro.proto Pb_MeetPlayFlag
     * fixed32  triggeruserval=3;//参见Interface_Macro.proto文件中的Pb_TriggerUsedef定义
     * repeated fixed32 deviceid=4;//通知的目标设备,为空表示全部
     */
    public void setPlayPause(@ResId int resId, int playflag, int triggeruserval, List<Integer> devIds) {
        InterfacePlaymedia.pbui_Type_MeetDoPlayControl build = InterfacePlaymedia.pbui_Type_MeetDoPlayControl.newBuilder()
                .setResindex(resId)
                .setPlayflag(playflag)
                .setTriggeruserval(triggeruserval)
                .addAllDeviceid(devIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEDIAPLAY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_PAUSE.getNumber(), build.toByteArray());
    }

    /**
     * 设置播放恢复
     * fixed32  resindex=1;//资源索引号 初始化播放资源时传入的资源ID eg:0,1,2,3 etc
     * fixed32  playflag=2;//播放标志 参见Interface_Macro.proto Pb_MeetPlayFlag
     * fixed32  triggeruserval=3;//参见Interface_Macro.proto文件中的Pb_TriggerUsedef定义
     * repeated fixed32 deviceid=4;//通知的目标设备,为空表示全部
     */
    public void setPlayRecover(@ResId int resId, int playflag, int triggeruserval, List<Integer> devIds) {
        InterfacePlaymedia.pbui_Type_MeetDoPlayControl build = InterfacePlaymedia.pbui_Type_MeetDoPlayControl.newBuilder()
                .setResindex(resId)
                .setPlayflag(playflag)
                .setTriggeruserval(triggeruserval)
                .addAllDeviceid(devIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEDIAPLAY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_PLAY.getNumber(), build.toByteArray());
    }

    /**
     * 查询媒体播放
     *
     * @return List<InterfacePlaymedia.pbui_Item_MeetMediaPlayDetailInfo>
     */
    public InterfacePlaymedia.pbui_Type_MeetMediaPlayDetailInfo queryMediaPlay() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEDIAPLAY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfacePlaymedia.pbui_Type_MeetMediaPlayDetailInfo info = InterfacePlaymedia.pbui_Type_MeetMediaPlayDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 推送文件
     * fixed32 mediaId=1;//媒体ID
     * fixed32 triggeruserval=2;//参见Interface_Macro.proto文件中的 Pb_TriggerUsedef 定义
     * repeated fixed32 deviceid=3;//通知的目标设备,为空表示全部
     */
    public void pushFile(int mediaId, int triggeruserval, List<Integer> devIds) {
        InterfacePlaymedia.pbui_Type_DoFilePush build = InterfacePlaymedia.pbui_Type_DoFilePush.newBuilder()
                .setMediaid(mediaId)
                .setTriggeruserval(triggeruserval)
                .addAllDeviceid(devIds)
                .build();
        LogUtils.i("推送文件 mediaId:" + mediaId + ",triggeruserval:" + triggeruserval + ",devIds:" + devIds);
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEDIAPLAY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_PUSH.getNumber(), build.toByteArray());
    }

    //流播放相关

    /**
     * 请求播放流通道
     * fixed32  triggeruserval=1;		  //参见Interface_Macro.proto文件中的Pb_TriggerUsedef定义
     * fixed32  handledeviceid=2;        //处理该请求的设备ID 采集端的设备ID
     * fixed32  substreamindex=3;        //本设备子通道号  这个是设备注册的流通索引 eg:如设置的桌面流通索引是2 摄像流通道是3
     * repeated fixed32 deviceid=4;	  //通知的目标设备,为空表示全部
     */
    public void streamPlayChannel(int triggeruserval, int devId, int sub, List<Integer> devIds) {
        InterfaceStream.pbui_Type_DoReqStreamPush build = InterfaceStream.pbui_Type_DoReqStreamPush.newBuilder()
                .setTriggeruserval(triggeruserval)
                .setHandledeviceid(devId)
                .setSubstreamindex(sub)
                .addAllDeviceid(devIds)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_STREAMPLAY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_REQUESTPUSH.getNumber(), build.toByteArray());
    }

    /**
     * 推送流
     * fixed32  triggeruserval=1;//参见Interface_Macro.proto文件中的Pb_TriggerUsedef定义
     * fixed32  deviceid=2;       //发起请求的设备ID 采集端的设备ID
     * fixed32  substreamindex=3; //本设备子通道号 这个是设备注册的流通索引 eg:如设置的桌面流通索引是2 摄像流通道是3
     */
    public void pushStream(int triggeruserval, int srcDevId, int sub) {
        InterfaceStream.pbui_Type_DoStreamPush build = InterfaceStream.pbui_Type_DoStreamPush.newBuilder()
                .setTriggeruserval(triggeruserval)
                .setSrcdeviceid(srcDevId)
                .setSubstreamindex(sub)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_STREAMPLAY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_PUSH.getNumber(), build.toByteArray());
    }

    /**
     * 流播放
     * fixed32  srcdeviceid=1;//设备ID 采集端的设备ID
     * fixed32  subid=2;//设备子通道 这个是设备注册的流通索引 eg:如设置的桌面流通索引是2 摄像流通道是3
     * fixed32  playflag=3;//播放标志 参见Interface_Macro.proto Pb_MeetPlayFlag
     * fixed32  triggeruserval=4;//参见Interface_Macro.proto文件中的 Pb_TriggerUsedef 定义
     * <p>
     * repeated fixed32 res=5;	  //播放所用的资源,为空表示全部
     * repeated fixed32 deviceid=6;	  //通知的目标设备,为空表示全部
     */
    public void streamPlay(int srcDevId, int subId, int playflag, int triggeruserval, List<Integer> resId, List<Integer> devIds) {
        if (isNoStreamServer()) {
            ToastUtils.showLong("没有找到流服务器，请检查...");
            return;
        }
        InterfaceStream.pbui_Type_MeetDoStreamPlay build = InterfaceStream.pbui_Type_MeetDoStreamPlay.newBuilder()
                .setSrcdeviceid(srcDevId)
                .setSubid(subId)
                .setPlayflag(playflag)
                .setTriggeruserval(triggeruserval)
                .addAllRes(resId)
                .addAllDeviceid(devIds)
                .build();
        LogUtils.i("流播放 srcdev=" + srcDevId + ",subId=" + subId + ",playflag=" + playflag + ",triggeruserval=" + triggeruserval + ",resId=" + resId + ",devIds=" + devIds);
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_STREAMPLAY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_START.getNumber(), build.toByteArray());
    }

    public void streamPlay(int srcDevId, int subId, int playflag, int triggeruserval, @ResId int resId, List<Integer> devIds) {
        ArrayList<Integer> resIds = new ArrayList<>();
        resIds.add(resId);
        streamPlay(srcDevId, subId, playflag, triggeruserval, resIds, devIds);
    }

    public void streamPlay(int srcDevId, int subId, int playflag, int triggeruserval, @ResId int resId, int devId) {
        ArrayList<Integer> resIds = new ArrayList<>();
        ArrayList<Integer> devIds = new ArrayList<>();
        resIds.add(resId);
        devIds.add(devId);
        streamPlay(srcDevId, subId, playflag, triggeruserval, resIds, devIds);
    }

    /**
     * 查询流播放
     *
     * @return List<InterfaceStream.pbui_Item_MeetStreamPlayDetailInfo>
     */
    public InterfaceStream.pbui_Type_MeetStreamPlayDetailInfo queryStreamPlay() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_STREAMPLAY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceStream.pbui_Type_MeetStreamPlayDetailInfo info = InterfaceStream.pbui_Type_MeetStreamPlayDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    //会议统计相关

    /**
     * 查询会议统计
     *
     * @param meetingId 会议id =0表示当前会议
     */
    public void queryMeetingStatistic(int meetingId) {
        InterfaceStatistic.pbui_Type_MeetDoReqStatistic build = InterfaceStatistic.pbui_Type_MeetDoReqStatistic.newBuilder()
                .setMeetingid(meetingId)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETSTATISTIC.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), build.toByteArray());
    }

    /**
     * 查询会议统计
     * fixed32 quartertype=1;//参见 Pb_MeetStatisticFlag 定义
     * <p>
     * //统计时间段
     * fixed32 startyear=2; //
     * fixed32 startmonth=3; ////按月查询才有效
     * fixed32 endyear=4; //
     * fixed32 endmonth=5; ////按月查询才有效
     */
    public void queryMeetingStatisticByMonth(int quarterType, int startMonth, int endMonth) {
        InterfaceStatistic.pbui_Type_QueryQuarterStatistic build = InterfaceStatistic.pbui_Type_QueryQuarterStatistic.newBuilder()
                .setQuartertype(quarterType)
                .setStartmonth(startMonth)
                .setEndmonth(endMonth)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETSTATISTIC.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ASK.getNumber(), build.toByteArray());
    }

    //会议界面设置相关

    /**
     * 查询指定id的界面配置
     *
     * @param id Pb_MeetFaceID
     */
    public InterfaceFaceconfig.pbui_Type_FaceConfigInfo queryInterFaceConfigById(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETFACECONFIG.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceFaceconfig.pbui_Type_FaceConfigInfo info = InterfaceFaceconfig.pbui_Type_FaceConfigInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询界面配置
     *
     * @return InterfaceFaceconfig.pbui_Type_FaceConfigInfo
     */
    public InterfaceFaceconfig.pbui_Type_FaceConfigInfo queryInterFaceConfig() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETFACECONFIG.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceFaceconfig.pbui_Type_FaceConfigInfo info = InterfaceFaceconfig.pbui_Type_FaceConfigInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }


    /**
     * 修改界面配置项
     * pbui_Type_FaceConfigInfo(仅pbui_Item_FaceTextItemInfo有效
     * || 仅pbui_Item_FacePictureItemInfo有效
     * || 仅 pbui_Item_FaceOnlyTextItemInfo有效)
     *
     * @param bytes
     */
    public void modifyInterfaceConfig(byte[] bytes) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETFACECONFIG.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), bytes);
    }

    public void modifyInferFaceText(InterfaceFaceconfig.pbui_Item_FaceTextItemInfo item) {
        InterfaceFaceconfig.pbui_Type_FaceConfigInfo build = InterfaceFaceconfig.pbui_Type_FaceConfigInfo.newBuilder()
                .addText(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETFACECONFIG.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    public void modifyInferFacePicture(InterfaceFaceconfig.pbui_Item_FacePictureItemInfo item) {
        InterfaceFaceconfig.pbui_Type_FaceConfigInfo build = InterfaceFaceconfig.pbui_Type_FaceConfigInfo.newBuilder()
                .addPicture(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETFACECONFIG.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    public void modifyInferFaceOnlyText(InterfaceFaceconfig.pbui_Item_FaceOnlyTextItemInfo item) {
        InterfaceFaceconfig.pbui_Type_FaceConfigInfo build = InterfaceFaceconfig.pbui_Type_FaceConfigInfo.newBuilder()
                .addOnlytext(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETFACECONFIG.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    //缓存数据相关

    public void cache(int type) {
        cache(type, 0, 0);
    }

    /**
     * @param type      数据类型
     * @param cacheFlag 缓存标志 参见 Pb_CacheFlag =0x00000001表示强制缓存
     */
    public void cache(int type, int cacheFlag) {
        cache(type, cacheFlag, 0);
    }

    /**
     * @param type      数据类型
     * @param cacheflag 缓存标志 参见 Pb_CacheFlag =0x00000001表示强制缓存
     * @param id        id用法描述 eg:需要缓存目录id=0表示缓存所有目录信息(不包括目录里的文件),当id=1时表示缓存该目录里的文件
     *                  ,如果id=0不支持则会返回 ERROR_MEET_INTERFACE_PARAMETER（-12参数错误）
     */
    public void cache(int type, int cacheflag, int id) {
        InterfaceBase.pbui_MeetCacheOper build = InterfaceBase.pbui_MeetCacheOper.newBuilder()
                .setCacheflag(cacheflag)
                .setId(id)
                .build();
        jni.call_method(type, InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_CACHE.getNumber(), build.toByteArray());
    }

    public boolean checkCache(int type) {
        return checkCache(type, 0, 0);
    }

    public boolean checkCache(int type, int id) {
        return checkCache(type, id, 0);
    }

    public boolean checkCache(int type, int id, int cacheflag) {
        int ret = jni.call_checkcache(type, id, cacheflag);
        LogUtils.i("检查缓存 type=" + type + "-" + ErrorRet.getTypeMessage(type) + ",id=" + id + ",cacheflag=" + cacheflag + ",ret=" + ret);
        return ret >= 0;
    }

    //清除缓存相关

    /**
     * 清除缓存
     *
     * @param type 数据类型
     */
    public void clearCache(int type) {
        jni.call_method(type, InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_CLEAR.getNumber(), null);
    }

    /**
     * 清除全部数据
     */
    public void clearAllCache() {
        clearCache(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETCLEAR.getNumber());
    }

    //平台功能限制相关

    /**
     * 查询平台功能限制属性
     *
     * @param propertyid=1;//属性ID      详细用法参见 Pb_SystemFuncionPropertyId
     * @param parameter=2;//传入参数值
     * @param propertyval=3;//对应属性返回的值
     */
    public int queryRestrictedAttribute(int propertyid, int parameter, int propertyval) {
        InterfaceBase.pbui_Type_SystemFuntionLimitsProperty build = InterfaceBase.pbui_Type_SystemFuntionLimitsProperty.newBuilder()
                .setPropertyid(propertyid)
                .setParameter(parameter)
                .setPropertyval(propertyval)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_SYSTEMFUNCTIONLIMIT.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERYPROPERTY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceBase.pbui_CommonInt32uProperty info = InterfaceBase.pbui_CommonInt32uProperty.parseFrom(bytes);
                if (info != null) {
                    return info.getPropertyval();
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return -1;
    }

    /**
     * 查询平台功能限制
     *
     * @return 限制的功能id
     */
    public List<Integer> queryRestrictedFunctions() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_SYSTEMFUNCTIONLIMIT.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceBase.pbui_Type_SystemFuntionLimits info = InterfaceBase.pbui_Type_SystemFuntionLimits.parseFrom(bytes);
                if (info != null) {
                    return info.getFunctionidsList();
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    //自定义文件评分投票相关

    /**
     * 新建文件评分
     *
     * @param fileId 一般写0
     */
    public void createVote(int fileId, InterfaceFilescorevote.pbui_Type_Item_UserDefineFileScore score) {
        InterfaceFilescorevote.pbui_Type_UserDefineFileScore build = InterfaceFilescorevote.pbui_Type_UserDefineFileScore.newBuilder()
                .setFileid(fileId)
                .addItem(score)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_FILESCOREVOTE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 新建文件评分
     *
     * @param fileId 一般写0
     */
    public void createVote(int fileId, List<InterfaceFilescorevote.pbui_Type_Item_UserDefineFileScore> scores) {
        InterfaceFilescorevote.pbui_Type_UserDefineFileScore build = InterfaceFilescorevote.pbui_Type_UserDefineFileScore.newBuilder()
                .setFileid(fileId)
                .addAllItem(scores)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_FILESCOREVOTE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 修改文件评分
     *
     * @param fileId 一般写0
     */
    public void modifyScore(int fileId, InterfaceFilescorevote.pbui_Type_Item_UserDefineFileScore score) {
        InterfaceFilescorevote.pbui_Type_UserDefineFileScore build = InterfaceFilescorevote.pbui_Type_UserDefineFileScore.newBuilder()
                .setFileid(fileId)
                .addItem(score)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_FILESCOREVOTESIGN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(), build.toByteArray());
    }

    /**
     * 发起评分
     *
     * @param voteid    评分ID
     * @param voteflag  Pb_VoteStartFlag
     * @param timeouts
     * @param memberIds 人员ID
     */
    public void startScore(int voteid, int voteflag, int timeouts, List<Integer> memberIds) {
        InterfaceFilescorevote.pbui_Type_StartUserDefineFileScore build = InterfaceFilescorevote.pbui_Type_StartUserDefineFileScore.newBuilder()
                .addAllMemberid(memberIds)
                .setTimeouts(timeouts)
                .setVoteflag(voteflag)
                .setVoteid(voteid)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_FILESCOREVOTE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_START.getNumber(), build.toByteArray());
    }

    /**
     * 删除评分
     */
    public void deleteScore(int voteid) {
        InterfaceFilescorevote.pbui_Type_DeleteUserDefineFileScore build = InterfaceFilescorevote.pbui_Type_DeleteUserDefineFileScore.newBuilder()
                .addVoteid(voteid).build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_FILESCOREVOTE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 停止评分
     *
     * @param voteid 评分id
     */
    public void stopScore(int voteid) {
        InterfaceFilescorevote.pbui_Type_DeleteUserDefineFileScore build = InterfaceFilescorevote.pbui_Type_DeleteUserDefineFileScore.newBuilder()
                .addVoteid(voteid)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_FILESCOREVOTE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_STOP.getNumber(), build.toByteArray());
    }

    /**
     * 查询指定id的文件评分
     */
    public InterfaceFilescorevote.pbui_Type_Item_UserDefineFileScore queryScoreById(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_FILESCOREVOTE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceFilescorevote.pbui_Type_UserDefineFileScore info = InterfaceFilescorevote.pbui_Type_UserDefineFileScore.parseFrom(bytes);
                if (info != null) {
                    return info.getItem(0);
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询文件评分
     */
    public InterfaceFilescorevote.pbui_Type_UserDefineFileScore queryScore() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_FILESCOREVOTE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceFilescorevote.pbui_Type_UserDefineFileScore info = InterfaceFilescorevote.pbui_Type_UserDefineFileScore.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    //自定义文件评分投票记名相关

    /**
     * 查询指定投票的提交人
     *
     * @param id 投票id
     * @return
     */
    public InterfaceFilescorevote.pbui_Type_UserDefineFileScoreMemberStatistic querySubmitterByVote(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_FILESCOREVOTESIGN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceFilescorevote.pbui_Type_UserDefineFileScoreMemberStatistic info = InterfaceFilescorevote.pbui_Type_UserDefineFileScoreMemberStatistic.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询投票提交人属性
     *
     * @param propertyid=1;//数据ID Pb_FILESCOREVOTE_PropertyID
     * @param voteid=2;//传入参数
     * @param memberid=3;//传入参数   为0表示本身
     * @param propertyval=4;//返回值
     */
    public int querySubmitterAttribute(int propertyid, int voteid, int memberid, int propertyval) {
        InterfaceFilescorevote.pbui_Type_MeetFileScoreVoteQueryProperty build = InterfaceFilescorevote.pbui_Type_MeetFileScoreVoteQueryProperty.newBuilder()
                .setPropertyid(propertyid)
                .setVoteid(voteid)
                .setMemberid(memberid)
                .setPropertyval(propertyval)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_FILESCOREVOTESIGN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERYPROPERTY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceBase.pbui_CommonInt32uProperty info = InterfaceBase.pbui_CommonInt32uProperty.parseFrom(bytes);
                if (info != null) {
                    return info.getPropertyval();
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return -1;
    }

    /**
     * 提交文件评分结果
     *
     * @param voteid   评分id
     * @param memberid 人员id
     * @param opinion  意见
     * @param allscore 每个选项的分--根据实到人数计算
     */
    public void submitScore(int voteid, int memberid, String opinion, List<Integer> allscore) {
        InterfaceFilescorevote.pbui_Type_UserDefineFileScoreMemberStatisticNotify build = InterfaceFilescorevote.pbui_Type_UserDefineFileScoreMemberStatisticNotify.newBuilder()
                .setContent(s2b(opinion))
                .setMemberid(memberid)
                .addAllScore(allscore)
                .setVoteid(voteid).build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_FILESCOREVOTESIGN.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SUBMIT.getNumber(), build.toByteArray());
    }

    //会议短信通知

    /**
     * 发送短信
     * bytes  serverIP=1;        // 服务器IP
     * bytes  serverPort=2;      // 服务器端口号
     * bytes  ctrlType=3;        // 短信服务类型（发送，查询等 服务器响应的网页）
     * <p>
     * bytes  uname=4;           // 短信服务账户 名称
     * bytes  upwd=5;            // 短信服务账户 密码
     * repeated bytes numbers=6;  // 电话号码  （发送短信必填，其他请求可不填）
     * bytes  messageInfo=7;      // 短信内容  （发送短信必填，其他请求可不填）
     */
    public void sendSms(String ip, String port, String ctrlType, String userName, String userPwd, List<ByteString> numbers, String message) {
        InterfaceMsn.pbui_Type_SMSInfo build = InterfaceMsn.pbui_Type_SMSInfo.newBuilder()
                .setServerIP(s2b(ip))
                .setServerPort(s2b(port))
                .setCtrlType(s2b(ctrlType))
                .setUname(s2b(userName))
                .setUpwd(s2b(userPwd))
                .addAllNumbers(numbers)
                .setMessageInfo(s2b(message))
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_SMSSERVICE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SEND.getNumber(), build.toByteArray());
    }

    /**
     * 查询短信发送状态
     */
    public InterfaceMsn.pbui_Type_SMSSendStatus querySendSmsStatus(String ip, String port, String ctrlType, String userName, String userPwd, List<ByteString> numbers, String message) {
        InterfaceMsn.pbui_Type_SMSInfo build = InterfaceMsn.pbui_Type_SMSInfo.newBuilder()
                .setServerIP(s2b(ip))
                .setServerPort(s2b(port))
                .setCtrlType(s2b(ctrlType))
                .setUname(s2b(userName))
                .setUpwd(s2b(userPwd))
                .addAllNumbers(numbers)
                .setMessageInfo(s2b(message))
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_SMSSERVICE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceMsn.pbui_Type_SMSSendStatus info = InterfaceMsn.pbui_Type_SMSSendStatus.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询短信回复
     *
     * @return InterfaceMsn.pbui_Type_SMSRecvMsg
     */
    public InterfaceMsn.pbui_Type_SMSRecvMsg querySmsReply(String ip, String port, String ctrlType, String userName, String userPwd, List<ByteString> numbers, String message) {
        InterfaceMsn.pbui_Type_SMSInfo build = InterfaceMsn.pbui_Type_SMSInfo.newBuilder()
                .setServerIP(s2b(ip))
                .setServerPort(s2b(port))
                .setCtrlType(s2b(ctrlType))
                .setUname(s2b(userName))
                .setUpwd(s2b(userPwd))
                .addAllNumbers(numbers)
                .setMessageInfo(s2b(message))
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_SMSSERVICE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_TEXTMSG.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceMsn.pbui_Type_SMSRecvMsg info = InterfaceMsn.pbui_Type_SMSRecvMsg.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询短信余量
     */
    public InterfaceMsn.pbui_Type_SMSLastCount querySmsSize(String ip, String port, String ctrlType, String userName, String userPwd, List<ByteString> numbers, String message) {
        InterfaceMsn.pbui_Type_SMSInfo build = InterfaceMsn.pbui_Type_SMSInfo.newBuilder()
                .setServerIP(s2b(ip))
                .setServerPort(s2b(port))
                .setCtrlType(s2b(ctrlType))
                .setUname(s2b(userName))
                .setUpwd(s2b(userPwd))
                .addAllNumbers(numbers)
                .setMessageInfo(s2b(message))
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_SMSSERVICE.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_GETSIZE.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceMsn.pbui_Type_SMSLastCount info = InterfaceMsn.pbui_Type_SMSLastCount.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    //会议发布任务

    /**
     * 查询任务
     *
     * @return
     */
    public InterfaceTask.pbui_Type_MeetTaskInfo queryTask() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETTASK.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                InterfaceTask.pbui_Type_MeetTaskInfo info = InterfaceTask.pbui_Type_MeetTaskInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询任务详情
     *
     * @param id 任务id
     * @return
     */
    public InterfaceTask.pbui_Type_MeetTaskDetailInfo queryTaskDetails(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETTASK.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceTask.pbui_Type_MeetTaskDetailInfo info = InterfaceTask.pbui_Type_MeetTaskDetailInfo.parseFrom(bytes);
                if (info != null) {
                    return info;
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 删除任务
     *
     * @param id 任务id
     */
    public void deleteTask(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETTASK.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(), build.toByteArray());
    }

    /**
     * 添加任务
     */
    public void addTask(InterfaceTask.pbui_Item_MeetTaskDetailInfo item) {
        InterfaceTask.pbui_Type_MeetTaskDetailInfo build = InterfaceTask.pbui_Type_MeetTaskDetailInfo.newBuilder()
                .addItem(item)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETTASK.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 添加任务
     */
    public void addTask(List<InterfaceTask.pbui_Item_MeetTaskDetailInfo> items) {
        InterfaceTask.pbui_Type_MeetTaskDetailInfo build = InterfaceTask.pbui_Type_MeetTaskDetailInfo.newBuilder()
                .addAllItem(items)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETTASK.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 更新任务
     */
    public void updateTask(List<InterfaceTask.pbui_Item_MeetTaskDetailInfo> items) {
        InterfaceTask.pbui_Type_MeetTaskDetailInfo build = InterfaceTask.pbui_Type_MeetTaskDetailInfo.newBuilder()
                .addAllItem(items)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETTASK.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_UPDATE.getNumber(), build.toByteArray());
    }

    /**
     * 执行任务
     *
     * @param id 任务id
     */
    public void startTask(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETTASK.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_START.getNumber(), build.toByteArray());
    }

    /**
     * 停止任务
     *
     * @param id 任务id
     */
    public void stopTask(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETTASK.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_STOP.getNumber(), build.toByteArray());
    }

    //会议用户自定义数据相关

    /**
     * 查询会议自定义数据
     *
     * @return {@link InterfaceMeetuserdef.pbui_Type_MeetUserdefInfo}
     */
    public InterfaceMeetuserdef.pbui_Type_MeetUserdefInfo queryMeetCustomData() {
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETUSERDEF.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), null);
        if (bytes != null) {
            try {
                return InterfaceMeetuserdef.pbui_Type_MeetUserdefInfo.parseFrom(bytes);
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询指定ID的数据
     *
     * @param id {@link InterfacePublicinfo.Pb_PublicDefFlag}
     * @return {@link InterfaceMeetuserdef.pbui_Type_MeetUserdefItemInfo}
     */
    public InterfaceMeetuserdef.pbui_Type_MeetUserdefItemInfo queryMeetCustomDataById(int id) {
        InterfaceBase.pbui_QueryInfoByID build = InterfaceBase.pbui_QueryInfoByID.newBuilder()
                .setId(id)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETUSERDEF.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SINGLEQUERYBYID.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfaceMeetuserdef.pbui_Type_MeetUserdefInfo info = InterfaceMeetuserdef.pbui_Type_MeetUserdefInfo.parseFrom(bytes);
                for (int i = 0; i < info.getItemList().size(); i++) {
                    InterfaceMeetuserdef.pbui_Type_MeetUserdefItemInfo item = info.getItemList().get(i);
                    if (item.getId() == id) {
                        LogUtils.i("查询指定ID的数据成功 id=" + id);
                        return item;
                    }
                }
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        LogUtils.e("查询指定ID的数据失败 id=" + id);
        return null;
    }

    /**
     * 修改会议自定义数据
     *
     * @param id   自定义id
     * @param text 数据内容
     */
    public void modifyMeetCustomData(int id, String text) {
        InterfaceMeetuserdef.pbui_Type_MeetUserdefItemInfo build1 = InterfaceMeetuserdef.pbui_Type_MeetUserdefItemInfo.newBuilder()
                .setId(id)
                .setText(s2b(text))
                .build();
        InterfaceMeetuserdef.pbui_Type_MeetUserdefInfo build = InterfaceMeetuserdef.pbui_Type_MeetUserdefInfo.newBuilder()
                .addItem(build1)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETUSERDEF.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(),
                build.toByteArray());
        LogUtils.i("设置自定义json数据 id=" + id + ", json=" + text);
    }

    /**
     * 删除会议自定义数据
     */
    public void deleteMeetCustomData(int id, String text) {
        InterfaceMeetuserdef.pbui_Type_MeetUserdefItemInfo build1 = InterfaceMeetuserdef.pbui_Type_MeetUserdefItemInfo.newBuilder()
                .setId(id)
                .setText(s2b(text))
                .build();
        InterfaceMeetuserdef.pbui_Type_MeetUserdefInfo build = InterfaceMeetuserdef.pbui_Type_MeetUserdefInfo.newBuilder()
                .addItem(build1)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_MEETUSERDEF.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(),
                build.toByteArray());
    }


    /**
     * 查询会议自定义数据
     *
     * @param ids {@link InterfacePublicinfo.Pb_PublicDefFlag}
     * @return {@link InterfacePublicinfo.pbui_Type_meetPublicInfo}
     */
    public InterfacePublicinfo.pbui_Type_meetPublicInfo queryGlobalCustomData(List<Integer> ids) {
        InterfacePublicinfo.pbui_Type_meetQueryPublicInfo build = InterfacePublicinfo.pbui_Type_meetQueryPublicInfo.newBuilder()
                .addAllDataid(ids)
                .build();
        byte[] bytes = jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_PUBLICINFO.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), build.toByteArray());
        if (bytes != null) {
            try {
                InterfacePublicinfo.pbui_Type_meetPublicInfo info = InterfacePublicinfo.pbui_Type_meetPublicInfo.parseFrom(bytes);
                return info;
            } catch (InvalidProtocolBufferException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    /**
     * 查询会议系统日志,通过callback回调返回数据 {@link InterfaceSystemlog.pbui_Type_MeetingMeetSystemLog}
     *
     * @param meetid 会议id
     * @param stime  微秒级开始时间 microseconds
     * @param etime  微秒级结束时间 microseconds
     */
    public void queryMeetSystemLog(int meetid, long stime, long etime) {
        InterfaceSystemlog.pbui_Type_QueryMeetSystemLog build = InterfaceSystemlog.pbui_Type_QueryMeetSystemLog.newBuilder()
                .setMeetid(meetid)
                .setStartopertime(stime)
                .setEndopertime(etime)
                .setOperid(0)
                .setRoomid(0)
                .setDeviceid(0)
                .setUid(0)
                .setUrole(0)
                .setStartrow(0)
                .build();
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_SYSTEMLOG.getNumber(), InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(), build.toByteArray());
    }

    /**
     * 添加日志
     *
     * @param pageid   参见{@link InterfaceSystemlog.PB_SYSTEMLOG_PAGEID}
     * @param operid   参见{@link InterfaceSystemlog.PB_SYSTEMLOG_OPERID}
     * @param meetid   当前的会议id
     * @param roomid   会场id
     * @param deviceid 设备id，可直接传0
     * @param urole    参会人角色 {@link InterfaceMacro.Pb_MeetMemberRole}
     * @param uid      人员id
     * @param opertime 操作utc时间 微秒 （添加时不需要填写）
     * @param param    目前最多四个参数，根据操作（operid）对应的操作参数，用于快速统计，eg:播放的文件ID，播放的流设备ID,
     */
    public void addSystemLog(int pageid, int operid, int meetid, int roomid, int deviceid, int urole, int uid, long opertime, List<Integer> param) {
        InterfaceSystemlog.pbui_Add_MeetSystemLog build = InterfaceSystemlog.pbui_Add_MeetSystemLog.newBuilder()
                .setPageid(pageid)
                .setOperid(operid)
                .setMeetid(meetid)
                .setRoomid(roomid)
                .setDeviceid(deviceid)
                .setUrole(urole)
                .setUid(uid)
                .setOpertime(opertime)
                .addAllParam(param)
                .build();
        addSystemLog(build);
    }

    public void addSystemLog(InterfaceSystemlog.pbui_Add_MeetSystemLog build) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_SYSTEMLOG.getNumber(), InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_ADD.getNumber(), build.toByteArray());
    }

    /**
     * 参数说明
     * <ui>
     * <li>1:真人</ul>
     * <li>-1:不确定</li>
     * <li>-2:传入人脸数>1</li>
     * <li>-3:人脸过小</li>
     * <li>-4:角度过大</li>
     * <li>-5:人脸超出边界</li>
     * <li>-6:深度图错误</li>
     * <li>-7:红外图太亮了</li>
     * <li>-8:红外图太暗了</li>
     * <li>-100:人脸质量错误</li>
     * </ui>
     *
     * @param phone
     * @param faceImg
     */
    public void registerFace(String phone, ByteString faceImg) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ZKIDENTIFY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_MODIFY.getNumber(),
                InterfaceSignin.pbui_Type_ZKIdentify_Oper.newBuilder()
                        .setPersonid(0)
                        .setPhone(s2b(phone))
                        .setPfaceimg(faceImg)
                        .build().toByteArray());
    }

    /**
     * 查询已注册的人脸数据，结果是通过变更通知一个一个返回
     *
     * @return 通过变更通知返回数据 {@link InterfaceSignin.pbui_Type_ZKIdentify_QueryReturn}
     */
    public void queryRegisteredFace() {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ZKIDENTIFY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_QUERY.getNumber(),
                InterfaceSignin.pbui_Type_ZKIdentify_Simple.newBuilder()
                        .setFlag(0)
                        .build().toByteArray());
    }

    public void deleteRegisteredFace(String phone) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_ZKIDENTIFY.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_DEL.getNumber(),
                InterfaceSignin.pbui_Type_ZKIdentify_Simple.newBuilder()
                        .setFlag(0)
                        .addPhone(s2b(phone))
                        .build().toByteArray());
    }
    //<editor-fold desc="界面变更相关">

    /**
     * 切换发布机页面显示
     *
     * @param pageId {@link InterfaceDevice.Pb_SwitchPageId}
     */
    public void togglePublisherPage(int pageId) {
        jni.call_method(InterfaceMacro.Pb_Type.Pb_TYPE_MEET_INTERFACE_DEVICEOPER.getNumber(),
                InterfaceMacro.Pb_Method.Pb_METHOD_MEET_INTERFACE_SUBMIT.getNumber(),
                InterfaceDevice.pbui_Type_MeetSwitchToPage.newBuilder()
                        .setPageid(pageId)
                        .build().toByteArray());
    }
    //</editor-fold>
}